-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(payload-cloud): set up cron jobs on init #10106
base: main
Are you sure you want to change the base?
Conversation
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
const DEFAULT_CRON_JOB = { | ||
cron: DEFAULT_CRON, | ||
limit: DEFAULT_LIMIT, | ||
queue: 'default (every minute)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason we want to put every minute on the end here? What if they change the cron to no longer be every minute and this stays?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only ends up in the DB if the user does not define any cronJob. See line 142
If the user has tasks configured, we set up cron jobs on init.
We also make sure to only run on one instance using a instance identifier stored in a global.
This adds a new property to the payloadCloudPlugin:
jobs
.