Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

GermanJablo
Copy link
Contributor

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.

Copy link

socket-security bot commented Dec 20, 2024

👍 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.

View full report↗︎

@GermanJablo GermanJablo marked this pull request as draft December 20, 2024 18:53
@GermanJablo GermanJablo marked this pull request as ready for review December 20, 2024 20:00
packages/payload-cloud/src/types.ts Outdated Show resolved Hide resolved
const DEFAULT_CRON_JOB = {
cron: DEFAULT_CRON,
limit: DEFAULT_LIMIT,
queue: 'default (every minute)',
Copy link
Member

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?

Copy link
Contributor Author

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

packages/payload-cloud/src/types.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants