File tree Expand file tree Collapse file tree 7 files changed +7
-29
lines changed
Expand file tree Collapse file tree 7 files changed +7
-29
lines changed Original file line number Diff line number Diff line change 11gem 'sidekiq'
2- gem 'slim' , '>= 1.3.0'
3- gem 'sinatra' , '>= 1.3.0' , :require => nil
4-
5- gem 'sidekiq-status'
6- gem 'sidekiq-unique-jobs'
7- gem 'sidekiq-failures'
8-
9- gem 'clockwork'
10- gem 'daemons'
2+ gem 'sinatra'
Original file line number Diff line number Diff line change 11Redmine Sidekiq
22===============
33
4- Background jobs will use the [ Sidekiq] ( https://github.com/mperham/sidekiq ) on Redmine.
4+ Background jobs will use the [ Sidekiq] ( https://github.com/mperham/sidekiq ) on Redmine.
55You can Monitoring easily used by [ Sidekiq plugin] ( http://www.redmine.org/plugins/sidekiq ) .
66
77## Features
88
99* Administrator can use the Sidekiq Web UI from the top menu.
1010* Add to autoload_paths of the Plugin ` /app/workers ` .
11- * Add Middleware of ` sidekiq-status ` .
1211
1312## Installation
1413
@@ -47,7 +46,7 @@ Example of Sidekiq worker.
4746./plugins/redmine_sidekiq/workers/sandbox_worker.rb
4847```
4948
50- ### Sandbox Web UI
49+ ### Sandbox Web UI
5150Enqueue from the Web UI.
5251
5352```
@@ -67,6 +66,6 @@ Enqueue from the command line.
6766$ script/rails runner 'SandboxWorker.perform_async'
6867```
6968
70- ## License
69+ ## License
7170
7271* MIT
Original file line number Diff line number Diff line change 11class SandboxWorker
22 include Sidekiq ::Worker
3- include Sidekiq ::Status ::Worker
4- sidekiq_options retry : 2 , unique : true
3+ sidekiq_options retry : 2
54
65 def perform ( name = nil , count = nil )
76 puts 'Doing sandbox work'
Original file line number Diff line number Diff line change @@ -2,5 +2,3 @@ production:
22 redis:
33 url: redis://localhost:6379/8
44 namespace: mynamespace
5- status:
6- expiration: 30
Original file line number Diff line number Diff line change 44Redmine ::Plugin . register :redmine_sidekiq do
55 name 'Redmine Sidekiq plugin'
66 description 'This is a Sidekiq plugin for Redmine'
7- version '1.1 .0'
7+ version '2.0 .0'
88 url 'https://github.com/ogom/redmine_sidekiq'
99 author_url 'mailto:[email protected] ' 1010 author 'ogom'
Original file line number Diff line number Diff line change 11require 'sidekiq'
2- require 'sidekiq-status'
32
43module RedmineSidekiq
54 class Configure
65 file = File . join ( Rails . root , 'plugins/redmine_sidekiq/config/sidekiq.yml' )
76 if File . exist? ( file )
87 config = YAML . load_file ( file ) [ Rails . env ]
98 redis_conf = config [ 'redis' ] . symbolize_keys
10- st_expire = config [ 'status' ] [ 'expiration' ] . to_i
11- else
12- st_expire = 30
139 end
1410
1511 Sidekiq . configure_server do |config |
1612 config . redis = redis_conf if redis_conf
17- config . server_middleware do |chain |
18- chain . add Sidekiq ::Status ::ServerMiddleware , expiration : st_expire . minutes
19- end
2013 end
2114
2215 Sidekiq . configure_client do |config |
2316 config . redis = redis_conf if redis_conf
24- config . client_middleware do |chain |
25- chain . add Sidekiq ::Status ::ClientMiddleware
26- end
2717 end
2818
2919 Sidekiq ::Extensions ::ActiveRecord . module_eval do
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ module RedmineSidekiq
22 class Rails
33 Dir . glob ( File . join ( Redmine ::Plugin . directory , '*' ) ) . sort . each do |directory |
44 if File . directory? ( directory )
5- workers = File . join ( directory , " app" , " workers" )
5+ workers = File . join ( directory , ' app' , ' workers' )
66 if File . directory? ( workers )
77 ActiveSupport ::Dependencies . autoload_paths += [ workers ]
88 end
You can’t perform that action at this time.
0 commit comments