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

Dynamic Cron Jobs #450

Open
MehdiRtal opened this issue May 4, 2024 · 1 comment
Open

Dynamic Cron Jobs #450

MehdiRtal opened this issue May 4, 2024 · 1 comment

Comments

@MehdiRtal
Copy link

Will there be any support for dynamically creating cron jobs after starting the worker as stated in #197 ?
It can be something like "ArqRedis.schedule_job()".

@davidsonsalinas
Copy link

Hi MehdiRtal,

I saw your comment and I believe I can help you with this issue. To address the need for dynamically creating cron jobs after the worker has started, I implemented a solution where I created a worker that periodically checks my database for new jobs to schedule.

Here’s a high-level overview of the approach:

  1. Polling Mechanism: The worker periodically checks the database for any new jobs with a specific status, such as PENDING.
  2. Job Creation: When it detects a job with the PENDING status, it creates a new job using enqueue_job.

By using this approach, you can dynamically create and schedule jobs based on the conditions and timing you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants