mirror of
https://github.com/strapi/strapi.git
synced 2025-08-30 11:45:48 +00:00
chore: change all internal cron tasks to named tasks
This commit is contained in:
parent
504076d216
commit
6e4ffcae2c
@ -49,7 +49,10 @@ const sendUpdateProjectInformation = async (strapi: Core.Strapi) => {
|
|||||||
|
|
||||||
const startCron = (strapi: Core.Strapi) => {
|
const startCron = (strapi: Core.Strapi) => {
|
||||||
strapi.cron.add({
|
strapi.cron.add({
|
||||||
'0 0 0 * * *': () => sendUpdateProjectInformation(strapi),
|
sendProjectInformation: {
|
||||||
|
task: () => sendUpdateProjectInformation(strapi),
|
||||||
|
options: '0 0 0 * * *',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,7 +30,10 @@ const sendUpdateProjectInformation = async (strapi: Core.Strapi) => {
|
|||||||
|
|
||||||
const startCron = (strapi: Core.Strapi) => {
|
const startCron = (strapi: Core.Strapi) => {
|
||||||
strapi.cron.add({
|
strapi.cron.add({
|
||||||
'0 0 0 * * *': () => sendUpdateProjectInformation(strapi),
|
sendProjectInformation: {
|
||||||
|
task: () => sendUpdateProjectInformation(strapi),
|
||||||
|
options: '0 0 0 * * *',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -205,7 +205,13 @@ const checkLicense = async ({ strapi }: { strapi: Core.Strapi }) => {
|
|||||||
|
|
||||||
if (!shouldStayOffline) {
|
if (!shouldStayOffline) {
|
||||||
await onlineUpdate({ strapi });
|
await onlineUpdate({ strapi });
|
||||||
strapi.cron.add({ [shiftCronExpression('0 0 */12 * * *')]: onlineUpdate });
|
|
||||||
|
strapi.cron.add({
|
||||||
|
onlineUpdate: {
|
||||||
|
task: () => onlineUpdate({ strapi }),
|
||||||
|
options: shiftCronExpression('0 0 */12 * * *'),
|
||||||
|
},
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
if (!ee.licenseInfo.expireAt) {
|
if (!ee.licenseInfo.expireAt) {
|
||||||
return disable('Your license does not have offline support.');
|
return disable('Your license does not have offline support.');
|
||||||
|
@ -70,7 +70,12 @@ export default ({ strapi }: { strapi: Core.Strapi }) => {
|
|||||||
async registerCron() {
|
async registerCron() {
|
||||||
const weeklySchedule = await this.ensureWeeklyStoredCronSchedule();
|
const weeklySchedule = await this.ensureWeeklyStoredCronSchedule();
|
||||||
|
|
||||||
strapi.cron.add({ [weeklySchedule]: this.sendMetrics.bind(this) });
|
strapi.cron.add({
|
||||||
|
reviewWorkflowsWeekly: {
|
||||||
|
task: this.sendMetrics.bind(this),
|
||||||
|
options: weeklySchedule,
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -129,6 +129,11 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
|
|||||||
async registerCron() {
|
async registerCron() {
|
||||||
const weeklySchedule = await this.ensureWeeklyStoredCronSchedule();
|
const weeklySchedule = await this.ensureWeeklyStoredCronSchedule();
|
||||||
|
|
||||||
strapi.cron.add({ [weeklySchedule]: this.sendMetrics.bind(this) });
|
strapi.cron.add({
|
||||||
|
uploadWeekly: {
|
||||||
|
task: this.sendMetrics.bind(this),
|
||||||
|
options: weeklySchedule,
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user