diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-09 09:14:05 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-09 09:14:05 +0400 |
commit | c7bb3a1f726be189ccce51bdd631b26eb4f64db1 (patch) | |
tree | 9e55df4e9e0e4543dfd77de459888f1c0a47a41d /app | |
parent | 7bfd38eaa95988accfc6bb09759d7688126f5692 (diff) |
sidekiq
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin/dashboard_controller.rb | 4 | ||||
-rw-r--r-- | app/mailers/notify.rb | 2 | ||||
-rw-r--r-- | app/models/system_hook.rb | 2 | ||||
-rw-r--r-- | app/views/admin/dashboard/index.html.haml | 25 | ||||
-rw-r--r-- | app/views/admin/resque/show.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/admin.html.haml | 2 | ||||
-rw-r--r-- | app/workers/post_receive.rb | 6 | ||||
-rw-r--r-- | app/workers/system_hook_worker.rb | 6 |
8 files changed, 16 insertions, 35 deletions
diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb index 827dd0cf7cd..f97c56b0b31 100644 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@ -3,10 +3,6 @@ class Admin::DashboardController < AdminController @projects = Project.order("created_at DESC").limit(10) @users = User.order("created_at DESC").limit(10) - @resque_accessible = true - @workers = Resque.workers - @pending_jobs = Resque.size(:post_receive) - rescue Redis::InheritedError @resque_accessible = false end diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index cec680bc356..87d3e4b204e 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -1,5 +1,5 @@ class Notify < ActionMailer::Base - include Resque::Mailer + include Sidekiq::Mailer add_template_helper ApplicationHelper add_template_helper GitlabMarkdownHelper diff --git a/app/models/system_hook.rb b/app/models/system_hook.rb index 2ae5b1314e9..5f1bd6477c4 100644 --- a/app/models/system_hook.rb +++ b/app/models/system_hook.rb @@ -19,6 +19,6 @@ class SystemHook < WebHook end def async_execute(data) - Resque.enqueue(SystemHookWorker, id, data) + Sidekiq::Client.enqueue(SystemHookWorker, id, data) end end diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 672dad4377e..2e572aaba79 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -1,5 +1,5 @@ .admin_dash.row - .span3 + .span4 .ui-box %h5.title Projects .data.padded @@ -7,7 +7,7 @@ %h1= Project.count %hr = link_to 'New Project', new_project_path, class: "btn small" - .span3 + .span4 .ui-box %h5.title Groups .data.padded @@ -15,7 +15,7 @@ %h1= Group.count %hr = link_to 'New Group', new_admin_group_path, class: "btn small" - .span3 + .span4 .ui-box %h5.title Users .data.padded @@ -23,25 +23,6 @@ %h1= User.count %hr = link_to 'New User', new_admin_user_path, class: "btn small" - .span3 - .ui-box - %h5.title - Resque Workers - .data.padded - - if @resque_accessible - = link_to admin_resque_path do - %h1{class: @workers.present? ? "cgreen" : "cred"} - = @workers.count - %hr - %p - %strong{class: @pending_jobs > 0 ? "cred" : "cgreen"} - #{@pending_jobs} post receive jobs waiting - - else - = link_to admin_resque_path do - %h1.cdark ? - %hr - %p - %strong Resque status unknown .row .span6 diff --git a/app/views/admin/resque/show.html.haml b/app/views/admin/resque/show.html.haml index 41254a6b6c2..499738f9a06 100644 --- a/app/views/admin/resque/show.html.haml +++ b/app/views/admin/resque/show.html.haml @@ -1,4 +1,4 @@ -%h3.page_title Resque +%h3.page_title Background Jobs %br .ui-box - %iframe{src: resque_path, width: '100%', height: 600, style: "border: none"} + %iframe{src: sidekiq_path, width: '100%', height: 900, style: "border: none"} diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 6b643ec8ccb..a60e7febe76 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -19,6 +19,6 @@ = nav_link(controller: :hooks) do = link_to "Hooks", admin_hooks_path = nav_link(controller: :resque) do - = link_to "Resque", admin_resque_path + = link_to "Background Jobs", admin_resque_path .content= yield diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index 9e3f32f835d..e74379a65dd 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -1,7 +1,9 @@ class PostReceive - @queue = :post_receive + include Sidekiq::Worker - def self.perform(repo_path, oldrev, newrev, ref, identifier) + sidekiq_options queue: :post_receive + + def perform(repo_path, oldrev, newrev, ref, identifier) repo_path.gsub!(Gitlab.config.gitolite.repos_path.to_s, "") repo_path.gsub!(/.git$/, "") repo_path.gsub!(/^\//, "") diff --git a/app/workers/system_hook_worker.rb b/app/workers/system_hook_worker.rb index ca154136b97..3ebc62b7e7a 100644 --- a/app/workers/system_hook_worker.rb +++ b/app/workers/system_hook_worker.rb @@ -1,7 +1,9 @@ class SystemHookWorker - @queue = :system_hook + include Sidekiq::Worker - def self.perform(hook_id, data) + sidekiq_options queue: :system_hook + + def perform(hook_id, data) SystemHook.find(hook_id).execute data end end |