UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 1.14 kB
{"version":3,"file":"check-system-alerts.mjs","names":[],"sources":["../../../src/services/crons/check-system-alerts.ts"],"sourcesContent":["import { getAlertConfigs } from \"../../libs/alerts/alert-map.js\";\nimport type { ServiceFn } from \"../../utils/services/types.js\";\n\nconst checkSystemAlerts: ServiceFn<[], undefined> = async (context) => {\n\tfor (const config of getAlertConfigs()) {\n\t\tif (!config.nightly) continue;\n\n\t\tconst queueRes = await context.queue.add(context, {\n\t\t\tevent: \"alert:execute\",\n\t\t\tpayload: {\n\t\t\t\tkey: config.key,\n\t\t\t\tsource: \"cron\",\n\t\t\t\ttrigger: \"scheduled\",\n\t\t\t\tmetadata: {},\n\t\t\t},\n\t\t});\n\t\tif (queueRes.error) return queueRes;\n\t}\n\n\treturn {\n\t\terror: undefined,\n\t\tdata: undefined,\n\t};\n};\n\nexport default checkSystemAlerts;\n"],"mappings":"kEAGA,MAAM,EAA8C,KAAO,IAAY,CACtE,IAAK,IAAM,KAAU,EAAgB,EAAG,CACvC,GAAI,CAAC,EAAO,QAAS,SAErB,IAAM,EAAW,MAAM,EAAQ,MAAM,IAAI,EAAS,CACjD,MAAO,gBACP,QAAS,CACR,IAAK,EAAO,IACZ,OAAQ,OACR,QAAS,YACT,SAAU,CAAC,CACZ,CACD,CAAC,EACD,GAAI,EAAS,MAAO,OAAO,CAC5B,CAEA,MAAO,CACN,MAAO,IAAA,GACP,KAAM,IAAA,EACP,CACD"}