Created
August 31, 2022 11:05
-
-
Save ivorpad/d552a22e3b3438c18c268aef3550c157 to your computer and use it in GitHub Desktop.
Start Job in sidekiq-scheduler dynamically
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
Sidekiq.schedule = {"hello_world"=>{"dynamic"=>true, "cron"=>"* * * * * *", "class"=>"HelloJob", "enabled"=>false}} | |
Sidekiq::Scheduler.enabled = true | |
Sidekiq::Scheduler.reload_schedule! | |
# or | |
SidekiqScheduler::RedisManager.get_job_state("hello_world") # "{\"enabled\":false}" | |
state = {"enabled" => true} | |
SidekiqScheduler::RedisManager.set_job_state("hello_world", state) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment