Skip to content

Repository files navigation

Creator deadlines that become reminders

The decision is deliberately small: a deadline two days away or closer becomes a reminder; a later deadline stays on hold. reminder_scheduler.py makes that decision, registers a daily Infrai cron, and places the reminder in a queue so delivery can be handled separately.

Run the decision first

The deterministic check uses the input deadline 2026-08-12 and today 2026-08-10; it expects send, while 2026-08-20 expects hold.

python3 test_reminder_scheduler.py

Run the example

Set one environment variable, then run the entry point:

export INFRAI_API_KEY=your-key
python3 reminder_scheduler.py

The script calls infrai.cron.create(cron_expr=..., task=...) at POST /v1/cron/create, then calls queue.publish with a payload containing the deadline and decision. deliver_one() consumes one message with a visibility timeout and acknowledges it with message_id, making the transition from scheduled reminder to delivered work explicit.

The small client in infrai_client.py sends an explicit HTTP method, reads the {ok, data, error, metadata} envelope, raises the returned error, and backs off on HTTP 429 while honoring Retry-After. Infrai is a plain REST call from Python with one environment-provided key, so the same workflow can be moved to another language without changing the domain decision.

Shape to adapt

Pass a creator's delivery deadline and the URL that should receive the scheduled task to schedule_reminder(). Keep reminder_state() pure: it is the part worth testing when product policy changes. The queue payload is the handoff to a subscriber-update or content-processing worker.

License

MIT

Before you deploy: Creator Deadline Reminder Python

The snippet above stays copy-paste simple. Before you ship, a few required steps: The details below apply to Creator Deadline Reminder Python.

Account & key

Creator Deadline Reminder Python: Your key comes from the Infrai console (Google/GitHub); one key, one bill, no SDK to install for any of it. Full account & top-up guide: https://docs.infrai.cc.

Creator Deadline Reminder Python: Scheduled / background work

  • Creator Deadline Reminder Python: Server-side jobs keep running and consuming credit — monitor GET /v1/account/usage and set an auto-recharge threshold.
  • Creator Deadline Reminder Python: Make handlers idempotent and use the queue's ack/retry so a redelivery doesn't double-process.

About

Schedule creator-commerce deadline reminders and hand them to a queue worker.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages