Updated cron
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user