I’m experimenting with my app in dev mode. I started app with IEX running and I have quantum schduler configured and running based on readme here https://github.com/c-rack/quantum-elixir . My scheduler is started under superviser as worker(App13.Scheduler, ), Now is there a way to update config with quantum params (list of scheduled tasks) and restart worker without exiting and starting the entire app from scratch?
I just realized that I can kill scheduler worker e.g. using observer. Supervisor starts (great!!! ) it again but it doesnt load updated dev.exs configs … any idea?
dev.exs is compiled in at compile-time, changing it won’t change the application environment except on startup.
However, you can update the application environment yourself.
Application.put_env/4 to put the same settings into the environment as you would have done in config. Do note that if it is a tree of settings then you’ll need to get it, update the part, then put it again (which it looks like you need to do with Quantum). At which point ‘then’ you can kill the supervisor and it’ll use new settings.
Honestly though I’d really recommend you to submit an Issue request to Quantum to allow for dynamic add/removal and the possibility to not use the config at all unless they don’t already have a way (in which case, you should use that way).
Actually as you an see here it looks like Quantum supports runtime editing of the jobs, so you don’t need to do any of that prior stuff anyway.
Thanks a lot for hints. One can define named jons https://hexdocs.pm/quantum/configuration.html#named-jobs and manupulate with job in IEX using their names e.g. https://hexdocs.pm/quantum/runtime.html#jobs-with-second-granularity
Quantum API is really great … whats more OTP is great here as I can manipulate live app in such an easy way …