Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
export const getQueuesWithSchedules = ({ jobsConfig })=>{
|
|
const tasksWithSchedules = jobsConfig.tasks?.filter((task)=>{
|
|
return task.schedule?.length;
|
|
}) ?? [];
|
|
const workflowsWithSchedules = jobsConfig.workflows?.filter((workflow)=>{
|
|
return workflow.schedule?.length;
|
|
}) ?? [];
|
|
const queuesWithSchedules = {};
|
|
for (const task of tasksWithSchedules){
|
|
for (const schedule of task.schedule ?? []){
|
|
;
|
|
(queuesWithSchedules[schedule.queue] ??= {
|
|
schedules: []
|
|
}).schedules.push({
|
|
scheduleConfig: schedule,
|
|
taskConfig: task
|
|
});
|
|
}
|
|
}
|
|
for (const workflow of workflowsWithSchedules){
|
|
for (const schedule of workflow.schedule ?? []){
|
|
;
|
|
(queuesWithSchedules[schedule.queue] ??= {
|
|
schedules: []
|
|
}).schedules.push({
|
|
scheduleConfig: schedule,
|
|
workflowConfig: workflow
|
|
});
|
|
}
|
|
}
|
|
return queuesWithSchedules;
|
|
};
|
|
|
|
//# sourceMappingURL=getQueuesWithSchedules.js.map |