mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
feat(schedules): add timezone support for scheduled jobs and update database schema
- Introduced a new `commonTimezones` array for timezone selection in the UI. - Updated the schedule form to include an optional timezone field. - Modified the database schema to add a `timezone` column to the `schedule` table. - Enhanced the scheduling logic to utilize the specified timezone, defaulting to UTC if not provided.
This commit is contained in:
@@ -40,6 +40,7 @@ export const scheduleJob = (job: QueueJob) => {
|
||||
jobQueue.add(job.scheduleId, job, {
|
||||
repeat: {
|
||||
pattern: job.cronSchedule,
|
||||
tz: job.timezone || "UTC",
|
||||
},
|
||||
});
|
||||
} else if (job.type === "volume-backup") {
|
||||
|
||||
@@ -15,6 +15,7 @@ export const jobQueueSchema = z.discriminatedUnion("type", [
|
||||
cronSchedule: z.string(),
|
||||
type: z.literal("schedule"),
|
||||
scheduleId: z.string(),
|
||||
timezone: z.string().optional(),
|
||||
}),
|
||||
z.object({
|
||||
cronSchedule: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user