active_scheduler
active_scheduler copied to clipboard
Thoughts on autoloading
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.
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/
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
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!