mirror of
https://github.com/ComfortablyCoding/strapi-plugin-website-builder.git
synced 2025-12-18 00:04:52 -05:00
22 lines
400 B
JavaScript
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,
|
|
};
|