-
Notifications
You must be signed in to change notification settings - Fork 454
/
queue.ts
31 lines (27 loc) · 1.23 KB
/
queue.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import addExperimentResultsJob from "../jobs/updateExperimentResults";
import updateScheduledFeatures from "../jobs/updateScheduledFeatures";
import addWebhooksJob from "../jobs/webhooks";
import addCacheInvalidateJob from "../jobs/cacheInvalidate";
import addMetricUpdateJob from "../jobs/updateMetrics";
import addProxyUpdateJob from "../jobs/proxyUpdate";
import createInformationSchemaJob from "../jobs/createInformationSchema";
import updateInformationSchemaJob from "../jobs/updateInformationSchema";
import createAutoGeneratedMetrics from "../jobs/createAutoGeneratedMetrics";
import { CRON_ENABLED } from "../util/secrets";
import { getAgendaInstance } from "../services/queueing";
import updateStaleInformationSchemaTable from "../jobs/updateStaleInformationSchemaTable";
export async function queueInit() {
if (!CRON_ENABLED) return;
const agenda = getAgendaInstance();
addExperimentResultsJob(agenda);
updateScheduledFeatures(agenda);
addMetricUpdateJob(agenda);
addWebhooksJob(agenda);
addCacheInvalidateJob(agenda);
addProxyUpdateJob(agenda);
createInformationSchemaJob(agenda);
updateInformationSchemaJob(agenda);
createAutoGeneratedMetrics(agenda);
updateStaleInformationSchemaTable(agenda);
await agenda.start();
}