add model CronJob

This commit is contained in:
Ishaan Jaff 2025-03-27 21:10:26 -07:00
parent e65b708fa2
commit ea93a09b7a
2 changed files with 30 additions and 0 deletions

View file

@ -336,3 +336,18 @@ model LiteLLM_DailyUserSpend {
@@index([api_key]) @@index([api_key])
@@index([model]) @@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
}

View file

@ -335,3 +335,18 @@ model LiteLLM_DailyUserSpend {
@@index([api_key]) @@index([api_key])
@@index([model]) @@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
}