clockwork_web
clockwork_web copied to clipboard
Add new Run Now button + fix on callback
There are times where we don't want to wait for the event to happen and manually execute/run the event.
This PR introduces:
-
a new
Run nowbutton next to theEnable/Disablebutton- After carefully reading
clockworksource code, usingevent.run(Time.now)handles the setting ofevent.last - it also calls
set_last_runto update redis as well.
- After carefully reading
-
Setting Last run in
after_runcallback- I usually have
every(1.minutes, 'job_name') { SomeSidekiqJob.perform_async } - What can happen here, is that the block can raise an exception. For my case, it can be redis ( the one for Sidekiq not clockwork_web) is down or Out Of Memory for example. But it can also be any ruby error
- So setting "last_run" on Clockwork_web's redis after being run is a safer and more accurate way to set it than setting it before it's run, which can be misleading
Here is a screenshot:
- I usually have