UNPKG

payload

Version:

Node, React, Headless CMS and Application Framework built on Next.js

18 lines (17 loc) 711 B
import { countRunnableOrActiveJobsForQueue } from './countRunnableOrActiveJobsForQueue.js'; export const defaultBeforeSchedule = async ({ queueable, req })=>{ // All tasks in that queue that are either currently processing or can be run const runnableOrActiveJobsForQueue = await countRunnableOrActiveJobsForQueue({ onlyScheduled: true, queue: queueable.scheduleConfig.queue, req, taskSlug: queueable.taskConfig?.slug, workflowSlug: queueable.workflowConfig?.slug }); return { input: {}, shouldSchedule: runnableOrActiveJobsForQueue === 0, waitUntil: queueable.waitUntil }; }; //# sourceMappingURL=defaultBeforeSchedule.js.map