Skip to content

Open source CapCut alternative.

TypeScript
764 B
Raw Blame
// Deferred work the back office runs off the request path. A request there
// writes a row and publishes its id to a Cloudflare Queue; its own queue
// consumer (donkey-jobs-worker) calls its /api/jobs/worker one at a time,
// and the creator polls the row. Job kinds and their payload schemas live in
// its code.

model AsyncJob {
  id        String   @id @default(cuid())
  kind      String
  payload   Json
  state     String   @default("queued") // queued | running | done | error
  // When a held-back job is due; the message carrying it is delayed to match,
  // so a poll before then republishes nothing.
  notBefore DateTime?
  result    Json?
  error     String?
  createdBy String
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}