daedalus 907759456b refactor(bootstrap): move bootstrap code under single folder
feat(boostrapEvents): add wildcard support for uid and actions
2023-09-19 20:46:19 -04:00

22 lines
400 B
JavaScript

'use strict';
const { getService } = require('../utils/common');
function bootstrapCron({ strapi, build }) {
// create cron check
strapi.cron.add({
[build.name]: {
options: {
rule: build.trigger.expression,
},
task: () => {
getService({ strapi, name: 'build' }).trigger({ name: build.name, trigger: { type: 'cron' } });
},
},
});
}
module.exports = {
bootstrapCron,
};