Last active
September 15, 2022 13:42
-
-
Save noniq/d07c7ce614b004832385743e03ce8900 to your computer and use it in GitHub Desktop.
Code reloading with Sidekiq and Zeitwerk (if not using Rails)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loader = Zeitwerk::Loader.new | |
loader.push_dir(__dir__) | |
if ENV['RACK_ENV'] == 'production' | |
loader.setup | |
Zeitwerk::Loader.eager_load_all | |
else | |
loader.enable_reloading | |
loader.setup | |
Sidekiq.configure_server do |config| | |
config[:reloader] = ->(&block){ loader.reload; block.call } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment