-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundIf it breaks the basic use of the product but can be worked aroundsource: typescriptSource is related to TypeScript (typings, tooling, ...)Source is related to TypeScript (typings, tooling, ...)status: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members
Description
Bug report
Strapi documantation states that cron task should be:
module.exports = () => ({
bootstrap({ strapi }) {
strapi.cron.add({
myJob: {
task: ({ strapi }) => {
console.log("hello from plugin");
},
options: {
rule: "* * * * * *", // << Notice that `options` has an attribute `rule`
},
},
});
},
});however
type Task = TaskFn | {
task: TaskFn;
options: string; // Notice `options` is a string
};Does not have rule, which results to task isn't being created
Required System information
- Node.js version: v18.18.2
- NPM version: 8.13.1
- Strapi version: 4.17.1
- Database: Postgres
- Operating system: Windows
- Is your project Javascript or Typescript: Typescript
Describe the bug
The full description coming from strapi/documentation#1954
Steps to reproduce the behavior
- Create new strapi
- Add cron task to
bootstrapbased on documentation - Notice task never fires
Expected behavior
Task created with:
module.exports = () => ({
bootstrap({ strapi }) {
strapi.cron.add({
myJob: {
task: ({ strapi }) => {
console.log("hello from plugin");
},
options: {
rule: "* * * * * *", // << Notice that `options` has an attribute `rule`
},
},
});
},
});Would console.log every minute.
Additional context
Metadata
Metadata
Assignees
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundIf it breaks the basic use of the product but can be worked aroundsource: typescriptSource is related to TypeScript (typings, tooling, ...)Source is related to TypeScript (typings, tooling, ...)status: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members
Type
Projects
Status
Fixed/Shipped