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

Improved reloading #1022

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

Conversation

thisduck
Copy link

@thisduck thisduck commented Apr 3, 2018

Currently the code reloads the Rails app every 5 seconds (default wait time).
This is not necessary, as the reload only needs to happen when there are jobs to run.

I modified the code to check if there are jobs to run by adding a jobs_to_run? method which checks to see if the backend has implemented this method. If the method is not implemented by the backend, then the reloading will happen every 5 seconds as it used to.

If the backend has implemented the method, then reloading will only happen when there are jobs to run.
This is similar to when Rails reloads the code, only when there is a web request and not every X seconds.

I have opened a pull request with delayed_job_active_record to add the method: collectiveidea/delayed_job_active_record#153

@albus522
Copy link
Member

This is interesting and I want to take a deeper look into it, but I don't have the time at this moment.

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

Successfully merging this pull request may close these issues.

None yet

2 participants