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

Thoughts on autoloading #18

Open
trobrock opened this issue Nov 8, 2019 · 3 comments · May be fixed by #23
Open

Thoughts on autoloading #18

trobrock opened this issue Nov 8, 2019 · 3 comments · May be fixed by #23
Labels
PR Welcomed Will merge/release a community-made fix

Comments

@trobrock
Copy link

trobrock commented Nov 8, 2019

I currently set my schedule within an initializer and using this gem causes my jobs to be autoloaded, which in Rails 6 is now deprecated. I'm doing this in an initializer to enable me to use the resque-scheduler web UI. The error I get is below. I was wondering if anyone had any good solutions to this.

Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.

Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload ApplicationJob, for example,
the expected changes won't be reflected in that stale Class object.

These autoloaded constants have been unloaded.

Please, check the "Autoloading and Reloading Constants" guide for solutions.
@trobrock
Copy link
Author

i just wanted to update here. I've started using the to_prepare API to work around the autoloading issue.

https://www.danott.co/today-i-learned/2019-10-16/

@JustinAiken JustinAiken added the PR Welcomed Will merge/release a community-made fix label Mar 17, 2021
@JustinAiken
Copy link
Owner

I don't use this library myself anymore, but if any PRs emerge to fix the issue, happy to merge and push out a new release

@josh-m-sharpe
Copy link

think i fixed this issue with that there PR ^^.

As an aside, is this what the cool kids use these days to make scheduler and active job play nice? seems like an obvious thing to work together, but wondering if there's more standard solution out there. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR Welcomed Will merge/release a community-made fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants