diff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prisma index 9269e89014..0df675fd84 100644 --- a/litellm/proxy/schema.prisma +++ b/litellm/proxy/schema.prisma @@ -336,3 +336,18 @@ model LiteLLM_DailyUserSpend { @@index([api_key]) @@index([model]) } + + +// Track the status of cron jobs running. Only allow one pod to run the job at a time +model CronJob { + id String @id @default(cuid()) // Unique ID for the record + podId String // Unique identifier for the pod acting as the leader + status JobStatus @default(INACTIVE) // Status of the cron job (active or inactive) + lastUpdated DateTime @default(now()) // Timestamp for the last update of the cron job record + ttl DateTime // Time when the leader's lease expires +} + +enum JobStatus { + ACTIVE + INACTIVE +} diff --git a/schema.prisma b/schema.prisma index 3312b26354..5d1535d2ff 100644 --- a/schema.prisma +++ b/schema.prisma @@ -335,3 +335,18 @@ model LiteLLM_DailyUserSpend { @@index([api_key]) @@index([model]) } + + +// Track the status of cron jobs running. Only allow one pod to run the job at a time +model CronJob { + id String @id @default(cuid()) // Unique ID for the record + podId String // Unique identifier for the pod acting as the leader + status JobStatus @default(INACTIVE) // Status of the cron job (active or inactive) + lastUpdated DateTime @default(now()) // Timestamp for the last update of the cron job record + ttl DateTime // Time when the leader's lease expires +} + +enum JobStatus { + ACTIVE + INACTIVE +}