diff options
Diffstat (limited to 'src/tasks/handleReminders.ts')
-rw-r--r-- | src/tasks/handleReminders.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tasks/handleReminders.ts b/src/tasks/handleReminders.ts index d1af480..e281903 100644 --- a/src/tasks/handleReminders.ts +++ b/src/tasks/handleReminders.ts @@ -1,10 +1,10 @@ -import { BushTask, Reminder } from '#lib'; +import { BushTask, Reminder, Time } from '#lib'; const { Op } = (await import('sequelize')).default; export default class HandlerRemindersTask extends BushTask { public constructor() { super('handlerReminders', { - delay: 30_000, // 30 seconds + delay: 30 * Time.Second, runOnStart: true }); } @@ -13,7 +13,7 @@ export default class HandlerRemindersTask extends BushTask { const expiredEntries = await Reminder.findAll({ where: { expires: { - [Op.lt]: new Date(Date.now() + 30_000) // Find all rows with an expiry date before 30 seconds from now + [Op.lt]: new Date(Date.now() + 30 * Time.Second) // Find all rows with an expiry date before 30 seconds from now }, notified: false } |