mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
add model CronJob
This commit is contained in:
parent
e65b708fa2
commit
ea93a09b7a
2 changed files with 30 additions and 0 deletions
|
@ -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
|
||||||
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue