Files
ebbe.bassandClaude Sonnet 5.5 20510a73e5 feat: add scheduler and mail outbox
SMTP adapter with TLS and a fake, outbox with retries, backoff, rate limit and restart safety, scheduler tick with job-run records started by gunicorn, and a send_test_mail command.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3t4WL7bd9bdHHNjEsxzqC
2026-10-18 09:18:42 +02:00

22 lines
734 B
Python

from django.db import models
class JobRun(models.Model):
"""The record of one run of one job. Owned by `scheduler` (AD-19)."""
class Status(models.TextChoices):
RUNNING = "running"
OK = "ok"
ERROR = "error"
job = models.CharField(max_length=60)
started_at = models.DateTimeField()
finished_at = models.DateTimeField(null=True, blank=True)
status = models.CharField(max_length=10, choices=Status.choices, default=Status.RUNNING)
# A short summary, or the name of the error. Never personal content.
detail = models.CharField(max_length=200, blank=True)
class Meta:
indexes = [models.Index(fields=["job", "-started_at"])]
ordering = ["-started_at", "-id"]