From 96999d64368ae97bf84dafdb7984bd8af6ac684c Mon Sep 17 00:00:00 2001 From: Patrick Venetz Date: Wed, 12 Jan 2022 04:20:50 +0100 Subject: [PATCH] chore(republik-crowdfundings): Send payment reminders at 10pm, too --- .../republik-crowdfundings/lib/scheduler/index.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/republik-crowdfundings/lib/scheduler/index.js b/packages/republik-crowdfundings/lib/scheduler/index.js index 5c9ebd6d5..5ca4a7967 100644 --- a/packages/republik-crowdfundings/lib/scheduler/index.js +++ b/packages/republik-crowdfundings/lib/scheduler/index.js @@ -46,11 +46,23 @@ const init = async (context) => { schedulers.push( timeScheduler.init({ - name: 'payment-reminders', + name: 'payment-reminders-lunch', context, runFunc: (_args, context) => sendPaymentReminders(context), lockTtlSecs, runAtTime: '12:00', + runAtDaysOfWeek: [1, 2, 3, 4, 5], // Send reminder Monday to Friday + }), + ) + + schedulers.push( + timeScheduler.init({ + name: 'payment-reminders-nightshift', + context, + runFunc: (_args, context) => sendPaymentReminders(context), + lockTtlSecs, + runAtTime: '22:00', + runAtDaysOfWeek: [1, 2, 3, 4, 5], // Send reminder Monday to Friday }), )