Task Framework
Create a New Task
Prerequisites
Steps
from django.tasks import task
@task
def send_notification(user_id: str, message: str):
"""Send a notification to a user."""
from gyrinx.core.models import User
user = User.objects.get(pk=user_id)
# ... send notification logicNotes
Schedule a Task to Run Periodically
Prerequisites
Steps
Common Schedules
Schedule
Expression
Add a Kill Switch to a Task
Steps
Configure Retry Behaviour
Steps
Guidelines
Notes
Make a Task Idempotent
Pattern 1: Check Before Acting
Pattern 2: Upsert Operations
Pattern 3: Idempotency Keys
Test a Task Locally
Prerequisites
Steps
Remove a Scheduled Task
Steps
Notes
Debug a Failed Task
Steps
Last updated