Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+32
@@ -0,0 +1,32 @@
|
||||
export const ADMIN_BOOKING_REMINDER_SWEEP_JOB_ID =
|
||||
"admin-booking-reminder-sweep" as const;
|
||||
export const ADMIN_BOOKING_REMINDER_SWEEP_EVERY_MS = 60_000;
|
||||
|
||||
export async function registerAdminBookingReminderSweepCron(
|
||||
queue: {
|
||||
upsertJobScheduler(
|
||||
schedulerId: string,
|
||||
options: { every: number },
|
||||
template: { name: string; data: Record<string, unknown> }
|
||||
): Promise<unknown>;
|
||||
},
|
||||
env: NodeJS.ProcessEnv = process.env
|
||||
): Promise<void> {
|
||||
const parsed = Number(env.ADMIN_BOOKING_REMINDER_SWEEP_BATCH_SIZE);
|
||||
const take =
|
||||
Number.isFinite(parsed) && parsed > 0
|
||||
? Math.min(Math.floor(parsed), 1_000)
|
||||
: 250;
|
||||
await queue.upsertJobScheduler(
|
||||
ADMIN_BOOKING_REMINDER_SWEEP_JOB_ID,
|
||||
{ every: ADMIN_BOOKING_REMINDER_SWEEP_EVERY_MS },
|
||||
{
|
||||
name: ADMIN_BOOKING_REMINDER_SWEEP_JOB_ID,
|
||||
data: {
|
||||
kind: "cleanup.run",
|
||||
task: ADMIN_BOOKING_REMINDER_SWEEP_JOB_ID,
|
||||
take,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user