Updated cron

This commit is contained in:
2025-03-01 21:18:26 +01:00
parent 057a8e09cf
commit a40051e8af
3 changed files with 9 additions and 12 deletions

View File

@@ -11,13 +11,9 @@ export default async function loadCronEvents(ft: FileType) {
for (const file of cronFiles) {
const filePath = path.join(cronPath, file)
const { default: cron } = await import("file://" + filePath) as { default: ICron }
const { seconds, minutes, hours, dayOfMonth, month, dayOfWeek } = cron.time
const time = cron.time.seconds + " " +
cron.time.minutes + " " +
cron.time.hours + " " +
cron.time.dayOfMonth + " " +
cron.time.month + " " +
cron.time.dayOfWeek
const time = `${seconds} ${minutes} ${hours} ${dayOfMonth} ${month} ${dayOfWeek}`
new CronJob(time, cron.execute, cron.onComplete, cron.start, cron.timeZone).start()
}