Background jobs will use the Sidekiq on Redmine. You can Monitoring easily used by Sidekiq plugin.
- Administrator can use the Sidekiq Web UI from the top menu.
- Add to autoload_paths of the Plugin
/app/workers
. - IMPORTANT: Anyone trying to use the sidekiq
:delay
method, use:sidekiq_delay
instead because for former has clashes with Redmine safe attributes. There is NO change for:delay_for
and:delay_until
methods.
$ git clone https://github.com/ogom/redmine_sidekiq ./plugins/redmine_sidekiq
$ bundle install
Add worker classes in /plugins/[your plugin]/app/workers
.
class HardWorker
include Sidekiq::Worker
def perform(name, count)
# do something
end
end
It appears in the top menu.
Example of Sidekiq worker.
./plugins/redmine_sidekiq/app/workers/sandbox_worker.rb
Enqueue from the Web UI.
http://[redmine]/sidekiq/sandbox
Enqueue, click the perform_async(*args)
of the Jobs.
Enqueue from the command line.
$ bin/rails runner 'SandboxWorker.perform_async'
- MIT