Move to sidekiq
This commit is contained in:
parent
9137744c69
commit
ac1b4b583d
8
Capfile
8
Capfile
|
@ -1,8 +0,0 @@
|
|||
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
|
||||
|
||||
# Uncomment if you are using Rails' asset pipeline
|
||||
load 'deploy/assets'
|
||||
|
||||
Dir['vendor/gems/*/recipes/*.rb', 'vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
|
||||
|
||||
load 'config/deploy' # remove this line to skip loading any of the default tasks
|
15
Gemfile
15
Gemfile
|
@ -10,11 +10,15 @@ gem 'devise'
|
|||
gem 'pundit'
|
||||
|
||||
gem 'paperclip'
|
||||
gem 'resque'
|
||||
gem 'resque-status'
|
||||
gem 'resque_mailer'
|
||||
gem 'resque-scheduler', '~>2.5.4'
|
||||
gem 'perform_later', git: 'git://github.com/KensoDev/perform_later.git' # should be after resque_mailer
|
||||
gem 'sinatra', :require => nil
|
||||
gem 'sidekiq'
|
||||
gem 'kiqit'
|
||||
gem 'sidekiq-scheduler', '~> 2.0'
|
||||
#gem 'resque'
|
||||
#gem 'resque-status'
|
||||
#gem 'resque_mailer'
|
||||
#gem 'resque-scheduler', '~>2.5.4'
|
||||
#gem 'perform_later', git: 'git://github.com/KensoDev/perform_later.git' # should be after resque_mailer
|
||||
gem 'russian'
|
||||
gem 'state_machines-activerecord'
|
||||
gem 'redis-rails'
|
||||
|
@ -79,6 +83,7 @@ group :development do
|
|||
gem 'rails3-generators'
|
||||
gem 'hirb'
|
||||
gem 'shotgun'
|
||||
gem 'state_machines-graphviz'
|
||||
# Better Errors & RailsPanel
|
||||
gem 'better_errors'
|
||||
gem 'binding_of_caller'
|
||||
|
|
66
Gemfile.lock
66
Gemfile.lock
|
@ -1,13 +1,3 @@
|
|||
GIT
|
||||
remote: git://github.com/KensoDev/perform_later.git
|
||||
revision: afd40794aa7101c8e73e9f105a064dd9bec47e31
|
||||
specs:
|
||||
perform_later (1.3.0)
|
||||
rails (>= 3.0)
|
||||
redis
|
||||
resque (> 1.25)
|
||||
resque-scheduler
|
||||
|
||||
GIT
|
||||
remote: git://github.com/activeadmin/activeadmin.git
|
||||
revision: cce908d9793ba1fce8483afe5e4112f97d7d0857
|
||||
|
@ -122,6 +112,7 @@ GEM
|
|||
sass-rails (< 5.1)
|
||||
sprockets (< 4.0)
|
||||
concurrent-ruby (1.0.2)
|
||||
connection_pool (2.2.0)
|
||||
crack (0.4.3)
|
||||
safe_yaml (~> 1.0.0)
|
||||
daemons (1.2.3)
|
||||
|
@ -202,6 +193,9 @@ GEM
|
|||
actionpack (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
key_struct (0.4.2)
|
||||
kiqit (2.4.0)
|
||||
activerecord
|
||||
sidekiq (> 2.5)
|
||||
libv8 (3.16.14.15)
|
||||
localeapp (1.0.2)
|
||||
gli
|
||||
|
@ -237,7 +231,6 @@ GEM
|
|||
modware (0.1.2)
|
||||
its-it
|
||||
key_struct (~> 0.4)
|
||||
mono_logger (1.1.0)
|
||||
multi_json (1.12.1)
|
||||
multipart-post (2.0.0)
|
||||
nest (1.1.2)
|
||||
|
@ -326,7 +319,7 @@ GEM
|
|||
rb-fsevent (0.9.7)
|
||||
rb-inotify (0.9.7)
|
||||
ffi (>= 0.5.0)
|
||||
redis (3.0.7)
|
||||
redis (3.3.0)
|
||||
redis-actionpack (4.0.1)
|
||||
actionpack (~> 4)
|
||||
redis-rack (~> 1.5.0)
|
||||
|
@ -334,8 +327,6 @@ GEM
|
|||
redis-activesupport (4.1.5)
|
||||
activesupport (>= 3, < 5)
|
||||
redis-store (~> 1.1.0)
|
||||
redis-namespace (1.5.2)
|
||||
redis (~> 3.0, >= 3.0.4)
|
||||
redis-rack (1.5.0)
|
||||
rack (~> 1.5)
|
||||
redis-store (~> 1.1.0)
|
||||
|
@ -350,21 +341,6 @@ GEM
|
|||
ref (2.0.0)
|
||||
responders (2.2.0)
|
||||
railties (>= 4.2.0, < 5.1)
|
||||
resque (1.25.2)
|
||||
mono_logger (~> 1.0)
|
||||
multi_json (~> 1.0)
|
||||
redis-namespace (~> 1.3)
|
||||
sinatra (>= 0.9.2)
|
||||
vegas (~> 0.1.2)
|
||||
resque-scheduler (2.5.5)
|
||||
mono_logger (~> 1.0)
|
||||
redis (~> 3.0.4)
|
||||
resque (~> 1.25.1)
|
||||
rufus-scheduler (~> 2.0.24)
|
||||
resque-status (0.5.0)
|
||||
resque (~> 1.19)
|
||||
resque_mailer (2.3.0)
|
||||
actionmailer (>= 3.0)
|
||||
rest-client (1.8.0)
|
||||
http-cookie (>= 1.0.2, < 2.0)
|
||||
mime-types (>= 1.16, < 3.0)
|
||||
|
@ -387,13 +363,13 @@ GEM
|
|||
rspec-mocks (~> 3.4.0)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-support (3.4.1)
|
||||
ruby-graphviz (1.2.2)
|
||||
ruby-haml-js (0.0.5)
|
||||
execjs
|
||||
sprockets (>= 2.0.0)
|
||||
ruby_parser (3.8.2)
|
||||
sexp_processor (~> 4.1)
|
||||
rufus-scheduler (2.0.24)
|
||||
tzinfo (>= 0.3.22)
|
||||
rufus-scheduler (3.1.10)
|
||||
russian (0.6.0)
|
||||
i18n (>= 0.5.0)
|
||||
safe_yaml (1.0.4)
|
||||
|
@ -470,6 +446,16 @@ GEM
|
|||
shoulda-context (1.2.1)
|
||||
shoulda-matchers (2.8.0)
|
||||
activesupport (>= 3.0.0)
|
||||
sidekiq (4.1.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
connection_pool (~> 2.2, >= 2.2.0)
|
||||
redis (~> 3.2, >= 3.2.1)
|
||||
sidekiq-scheduler (2.0.7)
|
||||
multi_json (~> 1)
|
||||
redis (~> 3)
|
||||
rufus-scheduler (~> 3.1.8)
|
||||
sidekiq (>= 3)
|
||||
tilt (>= 1.4.0)
|
||||
simple_form (3.1.0.rc2)
|
||||
actionpack (~> 4.0)
|
||||
activemodel (~> 4.0)
|
||||
|
@ -477,8 +463,6 @@ GEM
|
|||
rack (~> 1.5)
|
||||
rack-protection (~> 1.4)
|
||||
tilt (>= 1.3, < 3)
|
||||
sitemap_generator (5.1.0)
|
||||
builder
|
||||
skinny (0.2.4)
|
||||
eventmachine (~> 1.0.0)
|
||||
thin (>= 1.5, < 1.7)
|
||||
|
@ -501,6 +485,9 @@ GEM
|
|||
state_machines-activerecord (0.4.0)
|
||||
activerecord (>= 4.1, < 5.1)
|
||||
state_machines-activemodel (>= 0.3.0)
|
||||
state_machines-graphviz (0.0.2)
|
||||
ruby-graphviz
|
||||
state_machines
|
||||
temple (0.7.7)
|
||||
test_after_commit (1.0.0)
|
||||
activerecord (>= 3.2)
|
||||
|
@ -526,8 +513,6 @@ GEM
|
|||
unf_ext
|
||||
unf_ext (0.0.7.2)
|
||||
valuable (0.9.12)
|
||||
vegas (0.1.11)
|
||||
rack (>= 1.0.0)
|
||||
warden (1.2.6)
|
||||
rack (>= 1.0)
|
||||
webmock (2.0.3)
|
||||
|
@ -559,6 +544,7 @@ DEPENDENCIES
|
|||
hirb
|
||||
jbuilder
|
||||
js-routes
|
||||
kiqit
|
||||
localeapp
|
||||
mailcatcher
|
||||
meta-tags
|
||||
|
@ -571,7 +557,6 @@ DEPENDENCIES
|
|||
ohm (~> 1.3.2)
|
||||
ohm-expire (~> 0.1.3)
|
||||
paperclip
|
||||
perform_later!
|
||||
pg
|
||||
puma
|
||||
pundit
|
||||
|
@ -585,10 +570,6 @@ DEPENDENCIES
|
|||
rake
|
||||
redis-rails
|
||||
redis-semaphore
|
||||
resque
|
||||
resque-scheduler (~> 2.5.4)
|
||||
resque-status
|
||||
resque_mailer
|
||||
rest-client
|
||||
rr
|
||||
rspec-rails
|
||||
|
@ -599,12 +580,15 @@ DEPENDENCIES
|
|||
shotgun
|
||||
shoulda
|
||||
shoulda-matchers
|
||||
sidekiq
|
||||
sidekiq-scheduler (~> 2.0)
|
||||
simple_form (= 3.1.0.rc2)
|
||||
sitemap_generator
|
||||
sinatra
|
||||
slim
|
||||
soundmanager-rails
|
||||
sprockets
|
||||
state_machines-activerecord
|
||||
state_machines-graphviz
|
||||
test_after_commit
|
||||
therubyracer
|
||||
therubyrhino
|
||||
|
|
2
Rakefile
2
Rakefile
|
@ -3,7 +3,5 @@
|
|||
|
||||
require File.expand_path('../config/application', __FILE__)
|
||||
require 'rake'
|
||||
require 'resque/tasks'
|
||||
require 'resque_scheduler/tasks'
|
||||
|
||||
Rosa::Application.load_tasks
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
ActiveAdmin.register_page 'Resque' do
|
||||
menu priority: 100, label: 'Resque', url: '/admin/resque/overview'
|
||||
end
|
|
@ -1,190 +0,0 @@
|
|||
angular.module("u2i.bootstrap.tpls", ["uib/template/tabs/tab.html", "uib/template/tabs/tabset.html", "uib/template/typeahead/typeahead-match.html",
|
||||
"uib/template/typeahead/typeahead-popup.html", "uib/template/pagination/pager.html",
|
||||
"uib/template/pagination/pagination.html", "uib/template/datepicker/datepicker.html",
|
||||
"uib/template/datepicker/popup.html", "uib/template/datepicker/year.html",
|
||||
"uib/template/datepicker/month.html", "uib/template/datepicker/day.html"]);
|
||||
|
||||
angular.module("uib/template/tabs/tab.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/tabs/tab.html",
|
||||
"<li ng-class=\"[{active: active, disabled: disabled}, classes]\" class=\"uib-tab nav-item\">\n" +
|
||||
" <a href ng-click=\"select($event)\" class=\"nav-link\" uib-tab-heading-transclude>{{heading}}</a>\n" +
|
||||
"</li>\n" +
|
||||
"");
|
||||
}]);
|
||||
|
||||
angular.module("uib/template/tabs/tabset.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/tabs/tabset.html",
|
||||
"<div>\n" +
|
||||
" <ul class=\"nav nav-{{tabset.type || 'tabs'}} bottom-space\" ng-class=\"{'nav-stacked': vertical, 'nav-justified': justified}\" ng-transclude></ul>\n" +
|
||||
" <div class=\"tab-content\">\n" +
|
||||
" <div class=\"tab-pane\"\n" +
|
||||
" ng-repeat=\"tab in tabset.tabs\"\n" +
|
||||
" ng-class=\"{active: tabset.active === tab.index}\"\n" +
|
||||
" uib-tab-content-transclude=\"tab\">\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
"</div>\n" +
|
||||
"");
|
||||
}]);
|
||||
|
||||
angular.module("uib/template/typeahead/typeahead-match.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/typeahead/typeahead-match.html",
|
||||
"<a href\n" +
|
||||
" tabindex=\"-1\"\n" +
|
||||
" ng-bind-html=\"match.label | uibTypeaheadHighlight:query\"\n" +
|
||||
" ng-attr-title=\"{{match.label}}\"></a>\n" +
|
||||
"");
|
||||
}]);
|
||||
|
||||
angular.module("uib/template/typeahead/typeahead-popup.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/typeahead/typeahead-popup.html",
|
||||
"<ul class=\"dropdown-menu\" ng-show=\"isOpen() && !moveInProgress\" ng-style=\"{top: position().top+'px', left: position().left+'px'}\" role=\"listbox\" aria-hidden=\"{{!isOpen()}}\">\n" +
|
||||
" <li ng-repeat=\"match in matches track by $index\" ng-class=\"{active: isActive($index) }\" ng-mouseenter=\"selectActive($index)\" ng-click=\"selectMatch($index, $event)\" role=\"option\" id=\"{{::match.id}}\">\n" +
|
||||
" <div uib-typeahead-match index=\"$index\" match=\"match\" query=\"query\" template-url=\"templateUrl\"></div>\n" +
|
||||
" </li>\n" +
|
||||
"</ul>\n" +
|
||||
"");
|
||||
}]);
|
||||
|
||||
angular.module("uib/template/pagination/pager.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/pagination/pager.html",
|
||||
"<ul class=\"pager\">\n" +
|
||||
" <li ng-class=\"{disabled: noPrevious()||ngDisabled, previous: align}\"><a href ng-click=\"selectPage(page - 1, $event)\">{{::getText('previous')}}</a></li>\n" +
|
||||
" <li ng-class=\"{disabled: noNext()||ngDisabled, next: align}\"><a href ng-click=\"selectPage(page + 1, $event)\">{{::getText('next')}}</a></li>\n" +
|
||||
"</ul>\n" +
|
||||
"");
|
||||
}]);
|
||||
|
||||
angular.module("uib/template/pagination/pagination.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/pagination/pagination.html",
|
||||
"<ul class=\"pagination\">\n" +
|
||||
" <li ng-if=\"::boundaryLinks\" ng-class=\"{disabled: noPrevious()||ngDisabled}\" class=\"pagination-first\"><a href ng-click=\"selectPage(1, $event)\">{{::getText('first')}}</a></li>\n" +
|
||||
" <li ng-if=\"::directionLinks\" ng-class=\"{disabled: noPrevious()||ngDisabled}\" class=\"pagination-prev\"><a href ng-click=\"selectPage(page - 1, $event)\">{{::getText('previous')}}</a></li>\n" +
|
||||
" <li ng-repeat=\"page in pages track by $index\" ng-class=\"{active: page.active,disabled: ngDisabled&&!page.active}\" class=\"pagination-page\"><a href ng-click=\"selectPage(page.number, $event)\">{{page.text}}</a></li>\n" +
|
||||
" <li ng-if=\"::directionLinks\" ng-class=\"{disabled: noNext()||ngDisabled}\" class=\"pagination-next\"><a href ng-click=\"selectPage(page + 1, $event)\">{{::getText('next')}}</a></li>\n" +
|
||||
" <li ng-if=\"::boundaryLinks\" ng-class=\"{disabled: noNext()||ngDisabled}\" class=\"pagination-last\"><a href ng-click=\"selectPage(totalPages, $event)\">{{::getText('last')}}</a></li>\n" +
|
||||
"</ul>\n" +
|
||||
"");
|
||||
}]);
|
||||
|
||||
angular.module("uib/template/datepicker/datepicker.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/datepicker/datepicker.html",
|
||||
"<div class=\"uib-datepicker\" ng-switch=\"datepickerMode\" role=\"application\" ng-keydown=\"keydown($event)\">\n" +
|
||||
" <uib-daypicker ng-switch-when=\"day\" tabindex=\"0\"></uib-daypicker>\n" +
|
||||
" <uib-monthpicker ng-switch-when=\"month\" tabindex=\"0\"></uib-monthpicker>\n" +
|
||||
" <uib-yearpicker ng-switch-when=\"year\" tabindex=\"0\"></uib-yearpicker>\n" +
|
||||
"</div>\n" +
|
||||
"");
|
||||
}]);
|
||||
|
||||
angular.module("uib/template/datepicker/day.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/datepicker/day.html",
|
||||
"<table class=\"uib-daypicker\" role=\"grid\" aria-labelledby=\"{{::uniqueId}}-title\" aria-activedescendant=\"{{activeDateId}}\">\n" +
|
||||
" <thead>\n" +
|
||||
" <tr>\n" +
|
||||
" <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left uib-left\" ng-click=\"move(-1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
|
||||
" <th colspan=\"{{::5 + showWeeks}}\"><button id=\"{{::uniqueId}}-title\" role=\"heading\" aria-live=\"assertive\" aria-atomic=\"true\" type=\"button\" class=\"btn btn-default btn-sm uib-title\" ng-click=\"toggleMode()\" ng-disabled=\"datepickerMode === maxMode\" tabindex=\"-1\"><strong>{{title}}</strong></button></th>\n" +
|
||||
" <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right uib-right\" ng-click=\"move(1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
|
||||
" </tr>\n" +
|
||||
" <tr>\n" +
|
||||
" <th ng-if=\"showWeeks\" class=\"text-center\"></th>\n" +
|
||||
" <th ng-repeat=\"label in ::labels track by $index\" class=\"text-center\"><small aria-label=\"{{::label.full}}\">{{::label.abbr}}</small></th>\n" +
|
||||
" </tr>\n" +
|
||||
" </thead>\n" +
|
||||
" <tbody>\n" +
|
||||
" <tr class=\"uib-weeks\" ng-repeat=\"row in rows track by $index\">\n" +
|
||||
" <td ng-if=\"showWeeks\" class=\"text-center h6\"><em>{{ weekNumbers[$index] }}</em></td>\n" +
|
||||
" <td ng-repeat=\"dt in row\" class=\"uib-day text-center\" role=\"gridcell\"\n" +
|
||||
" id=\"{{::dt.uid}}\"\n" +
|
||||
" ng-class=\"::dt.customClass\">\n" +
|
||||
" <button type=\"button\" class=\"btn btn-default btn-sm\"\n" +
|
||||
" uib-is-class=\"\n" +
|
||||
" 'btn-info' for selectedDt,\n" +
|
||||
" 'active' for activeDt\n" +
|
||||
" on dt\"\n" +
|
||||
" ng-click=\"select(dt.date)\"\n" +
|
||||
" ng-disabled=\"::dt.disabled\"\n" +
|
||||
" tabindex=\"-1\"><span ng-class=\"::{'text-muted': dt.secondary, 'text-info': dt.current}\">{{::dt.label}}</span></button>\n" +
|
||||
" </td>\n" +
|
||||
" </tr>\n" +
|
||||
" </tbody>\n" +
|
||||
"</table>\n" +
|
||||
"");
|
||||
}]);
|
||||
|
||||
angular.module("uib/template/datepicker/month.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/datepicker/month.html",
|
||||
"<table class=\"uib-monthpicker\" role=\"grid\" aria-labelledby=\"{{::uniqueId}}-title\" aria-activedescendant=\"{{activeDateId}}\">\n" +
|
||||
" <thead>\n" +
|
||||
" <tr>\n" +
|
||||
" <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left uib-left\" ng-click=\"move(-1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
|
||||
" <th><button id=\"{{::uniqueId}}-title\" role=\"heading\" aria-live=\"assertive\" aria-atomic=\"true\" type=\"button\" class=\"btn btn-default btn-sm uib-title\" ng-click=\"toggleMode()\" ng-disabled=\"datepickerMode === maxMode\" tabindex=\"-1\"><strong>{{title}}</strong></button></th>\n" +
|
||||
" <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right uib-right\" ng-click=\"move(1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
|
||||
" </tr>\n" +
|
||||
" </thead>\n" +
|
||||
" <tbody>\n" +
|
||||
" <tr class=\"uib-months\" ng-repeat=\"row in rows track by $index\">\n" +
|
||||
" <td ng-repeat=\"dt in row\" class=\"uib-month text-center\" role=\"gridcell\"\n" +
|
||||
" id=\"{{::dt.uid}}\"\n" +
|
||||
" ng-class=\"::dt.customClass\">\n" +
|
||||
" <button type=\"button\" class=\"btn btn-default\"\n" +
|
||||
" uib-is-class=\"\n" +
|
||||
" 'btn-info' for selectedDt,\n" +
|
||||
" 'active' for activeDt\n" +
|
||||
" on dt\"\n" +
|
||||
" ng-click=\"select(dt.date)\"\n" +
|
||||
" ng-disabled=\"::dt.disabled\"\n" +
|
||||
" tabindex=\"-1\"><span ng-class=\"::{'text-info': dt.current}\">{{::dt.label}}</span></button>\n" +
|
||||
" </td>\n" +
|
||||
" </tr>\n" +
|
||||
" </tbody>\n" +
|
||||
"</table>\n" +
|
||||
"");
|
||||
}]);
|
||||
|
||||
angular.module("uib/template/datepicker/popup.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/datepicker/popup.html",
|
||||
"<div>\n" +
|
||||
" <ul class=\"uib-datepicker-popup dropdown-menu uib-position-measure\" dropdown-nested ng-if=\"isOpen\" ng-keydown=\"keydown($event)\" ng-click=\"$event.stopPropagation()\">\n" +
|
||||
" <li ng-transclude></li>\n" +
|
||||
" <li ng-if=\"showButtonBar\" class=\"uib-button-bar\">\n" +
|
||||
" <span class=\"btn-group pull-left\">\n" +
|
||||
" <button type=\"button\" class=\"btn btn-sm btn-info uib-datepicker-current\" ng-click=\"select('today', $event)\" ng-disabled=\"isDisabled('today')\">{{ getText('current') }}</button>\n" +
|
||||
" <button type=\"button\" class=\"btn btn-sm btn-danger uib-clear\" ng-click=\"select(null, $event)\">{{ getText('clear') }}</button>\n" +
|
||||
" </span>\n" +
|
||||
" <button type=\"button\" class=\"btn btn-sm btn-success pull-right uib-close\" ng-click=\"close($event)\">{{ getText('close') }}</button>\n" +
|
||||
" </li>\n" +
|
||||
" </ul>\n" +
|
||||
"</div>\n" +
|
||||
"");
|
||||
}]);
|
||||
|
||||
angular.module("uib/template/datepicker/year.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("uib/template/datepicker/year.html",
|
||||
"<table class=\"uib-yearpicker\" role=\"grid\" aria-labelledby=\"{{::uniqueId}}-title\" aria-activedescendant=\"{{activeDateId}}\">\n" +
|
||||
" <thead>\n" +
|
||||
" <tr>\n" +
|
||||
" <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left uib-left\" ng-click=\"move(-1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
|
||||
" <th colspan=\"{{::columns - 2}}\"><button id=\"{{::uniqueId}}-title\" role=\"heading\" aria-live=\"assertive\" aria-atomic=\"true\" type=\"button\" class=\"btn btn-default btn-sm uib-title\" ng-click=\"toggleMode()\" ng-disabled=\"datepickerMode === maxMode\" tabindex=\"-1\"><strong>{{title}}</strong></button></th>\n" +
|
||||
" <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right uib-right\" ng-click=\"move(1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
|
||||
" </tr>\n" +
|
||||
" </thead>\n" +
|
||||
" <tbody>\n" +
|
||||
" <tr class=\"uib-years\" ng-repeat=\"row in rows track by $index\">\n" +
|
||||
" <td ng-repeat=\"dt in row\" class=\"uib-year text-center\" role=\"gridcell\"\n" +
|
||||
" id=\"{{::dt.uid}}\"\n" +
|
||||
" ng-class=\"::dt.customClass\">\n" +
|
||||
" <button type=\"button\" class=\"btn btn-default\"\n" +
|
||||
" uib-is-class=\"\n" +
|
||||
" 'btn-info' for selectedDt,\n" +
|
||||
" 'active' for activeDt\n" +
|
||||
" on dt\"\n" +
|
||||
" ng-click=\"select(dt.date)\"\n" +
|
||||
" ng-disabled=\"::dt.disabled\"\n" +
|
||||
" tabindex=\"-1\"><span ng-class=\"::{'text-info': dt.current}\">{{::dt.label}}</span></button>\n" +
|
||||
" </td>\n" +
|
||||
" </tr>\n" +
|
||||
" </tbody>\n" +
|
||||
"</table>\n" +
|
||||
"");
|
||||
}]);
|
|
@ -91,7 +91,7 @@ class Api::V1::JobsController < Api::V1::BaseController
|
|||
if QUEUES.include?(worker_queue) && QUEUE_CLASSES.include?(worker_class)
|
||||
worker_args = (params[:worker_args] || []).first || {}
|
||||
worker_args = worker_args.merge(feedback_from_user: current_user.id)
|
||||
Resque.push worker_queue, 'class' => worker_class, 'args' => [worker_args]
|
||||
Sidekiq::Client.push 'queue' => worker_queue, 'class' => worker_class, 'args' => [worker_args]
|
||||
render nothing: true
|
||||
else
|
||||
render nothing: true, status: 403
|
||||
|
|
|
@ -88,7 +88,7 @@ class Platforms::ProductBuildListsController < Platforms::BaseController
|
|||
@product_build_lists = @product_build_lists.
|
||||
includes(:project, product: :platform).
|
||||
recent.paginate(page: current_page)
|
||||
@build_server_status = AbfWorkerStatusPresenter.new.products_status
|
||||
#@build_server_status = AbfWorkerStatusPresenter.new.products_status
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
@ -35,7 +35,7 @@ class Projects::BuildListsController < Projects::BaseController
|
|||
:source_packages,
|
||||
project: :project_statistics)
|
||||
|
||||
@build_server_status = AbfWorkerStatusPresenter.new.projects_status
|
||||
#@build_server_status = AbfWorkerStatusPresenter.new.projects_status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -103,21 +103,21 @@ class Projects::BuildListsController < Projects::BaseController
|
|||
if prs.present? && prs[:projects].present? && prs[:arches].present?
|
||||
project_ids = prs[:projects].select{ |k, v| v == '1' }.keys
|
||||
arch_ids = prs[:arches]. select{ |k, v| v == '1' }.keys
|
||||
|
||||
Resque.enqueue(
|
||||
BuildLists::DependentPackagesJob,
|
||||
@build_list.id,
|
||||
current_user.id,
|
||||
project_ids,
|
||||
arch_ids,
|
||||
{
|
||||
auto_publish_status: prs[:auto_publish_status],
|
||||
auto_create_container: prs[:auto_create_container],
|
||||
include_testing_subrepository: prs[:include_testing_subrepository],
|
||||
use_cached_chroot: prs[:use_cached_chroot],
|
||||
use_extra_tests: prs[:use_extra_tests]
|
||||
}
|
||||
)
|
||||
#FIX
|
||||
# enqueue(
|
||||
# BuildLists::DependentPackagesJob,
|
||||
# @build_list.id,
|
||||
# current_user.id,
|
||||
# project_ids,
|
||||
# arch_ids,
|
||||
# {
|
||||
# auto_publish_status: prs[:auto_publish_status],
|
||||
# auto_create_container: prs[:auto_create_container],
|
||||
# include_testing_subrepository: prs[:include_testing_subrepository],
|
||||
# use_cached_chroot: prs[:use_cached_chroot],
|
||||
# use_extra_tests: prs[:use_extra_tests]
|
||||
# }
|
||||
# )
|
||||
flash[:notice] = t('flash.build_list.dependent_projects_job_added_to_queue')
|
||||
redirect_to build_list_path(@build_list)
|
||||
end
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
module AbfWorker
|
||||
class BaseObserver
|
||||
class BaseObserver < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
|
||||
COMPLETED = 0
|
||||
FAILED = 1
|
||||
PENDING = 2
|
||||
|
@ -9,13 +11,13 @@ module AbfWorker
|
|||
|
||||
attr_accessor :status, :options
|
||||
|
||||
def initialize(options, subject_class)
|
||||
def perform(options)
|
||||
@status = options['status'].to_i
|
||||
@options = options
|
||||
@subject_class = subject_class
|
||||
real_perform
|
||||
end
|
||||
|
||||
def perform
|
||||
def real_perform
|
||||
raise NotImplementedError, "You should implement this method"
|
||||
end
|
||||
|
||||
|
|
|
@ -1,30 +1,29 @@
|
|||
module AbfWorker
|
||||
class IsoWorkerObserver < AbfWorker::BaseObserver
|
||||
@queue = :iso_worker_observer
|
||||
sidekiq_options :queue => :iso_worker_observer
|
||||
|
||||
def self.perform(options)
|
||||
new(options, ProductBuildList).perform
|
||||
end
|
||||
def real_perform
|
||||
@subject_class = ProductBuildList
|
||||
subject.with_lock do
|
||||
case status
|
||||
when COMPLETED
|
||||
subject.build_success
|
||||
when FAILED
|
||||
|
||||
def perform
|
||||
case status
|
||||
when COMPLETED
|
||||
subject.build_success
|
||||
when FAILED
|
||||
case options['exit_status'].to_i
|
||||
when ProductBuildList::BUILD_COMPLETED_PARTIALLY
|
||||
subject.build_success_partially
|
||||
else
|
||||
subject.build_error
|
||||
end
|
||||
|
||||
case options['exit_status'].to_i
|
||||
when ProductBuildList::BUILD_COMPLETED_PARTIALLY
|
||||
subject.build_success_partially
|
||||
else
|
||||
subject.build_error
|
||||
when STARTED
|
||||
subject.start_build
|
||||
when CANCELED
|
||||
subject.build_canceled
|
||||
end
|
||||
|
||||
when STARTED
|
||||
subject.start_build
|
||||
when CANCELED
|
||||
subject.build_canceled
|
||||
update_results if status != STARTED
|
||||
end
|
||||
update_results if status != STARTED
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
module AbfWorker
|
||||
class PublishObserver < AbfWorker::BaseObserver
|
||||
@queue = :publish_observer
|
||||
sidekiq_options :queue => :publish_observer
|
||||
|
||||
def self.perform(options)
|
||||
new(options, BuildList).perform
|
||||
end
|
||||
|
||||
def perform
|
||||
def real_perform
|
||||
@subject_class = BuildList
|
||||
return if status == STARTED # do nothing when publication started
|
||||
extra = options['extra']
|
||||
repository_status = RepositoryStatus.where(id: extra['repository_status_id']).first
|
||||
|
|
|
@ -7,88 +7,73 @@ module AbfWorker
|
|||
# other - Build error
|
||||
EXIT_CODE_UNPERMITTED_ARCHITECTURE = 6
|
||||
|
||||
@queue = :rpm_worker_observer
|
||||
sidekiq_options :queue => :rpm_worker_observer
|
||||
|
||||
def self.perform(options)
|
||||
new(options, BuildList).perform
|
||||
end
|
||||
def real_perform
|
||||
@subject_class = BuildList
|
||||
subject.with_lock do
|
||||
unless subject.valid? && restart_task
|
||||
if options['feedback_from_user']
|
||||
user = User.find options['feedback_from_user']
|
||||
raise ActiveRecord::Rollback if !user.system? && subject.builder != user
|
||||
end
|
||||
|
||||
def perform
|
||||
return if subject.valid? && restart_task
|
||||
if options['feedback_from_user']
|
||||
user = User.find options['feedback_from_user']
|
||||
return if !user.system? && subject.builder != user
|
||||
end
|
||||
fill_container_data if status != STARTED
|
||||
|
||||
item = find_or_create_item
|
||||
fill_container_data if status != STARTED
|
||||
unless subject.valid?
|
||||
subject.build_error(false)
|
||||
subject.save(validate: false)
|
||||
return
|
||||
end
|
||||
|
||||
unless subject.valid?
|
||||
item.update_attributes({status: BuildList::BUILD_ERROR})
|
||||
subject.build_error(false)
|
||||
subject.save(validate: false)
|
||||
return
|
||||
end
|
||||
if options['hostname']
|
||||
subject.update_attribute(:hostname, options['hostname'])
|
||||
end
|
||||
|
||||
if options['hostname']
|
||||
subject.update_attribute(:hostname, options['hostname'])
|
||||
end
|
||||
if options['fail_reason']
|
||||
subject.update_attribute(:fail_reason, options['fail_reason'])
|
||||
end
|
||||
|
||||
if options['fail_reason']
|
||||
subject.update_attribute(:fail_reason, options['fail_reason'])
|
||||
end
|
||||
if options['commit_hash']
|
||||
subject.update_attribute(:commit_hash, options['commit_hash'])
|
||||
end
|
||||
|
||||
if options['commit_hash']
|
||||
item.update_attribute(:version, options['commit_hash'])
|
||||
subject.update_attribute(:commit_hash, options['commit_hash'])
|
||||
end
|
||||
rerunning_tests = subject.rerunning_tests?
|
||||
|
||||
rerunning_tests = subject.rerunning_tests?
|
||||
case status
|
||||
when COMPLETED
|
||||
subject.build_success
|
||||
if subject.can_auto_publish? && subject.can_publish?
|
||||
subject.now_publish
|
||||
elsif subject.auto_publish_into_testing? && subject.can_publish_into_testing?
|
||||
subject.publish_into_testing
|
||||
end
|
||||
when FAILED
|
||||
|
||||
case status
|
||||
when COMPLETED
|
||||
subject.build_success
|
||||
if subject.can_auto_publish? && subject.can_publish?
|
||||
subject.now_publish
|
||||
elsif subject.auto_publish_into_testing? && subject.can_publish_into_testing?
|
||||
subject.publish_into_testing
|
||||
case options['exit_status'].to_i
|
||||
when EXIT_CODE_UNPERMITTED_ARCHITECTURE
|
||||
subject.unpermitted_arch
|
||||
else
|
||||
subject.build_error
|
||||
end
|
||||
|
||||
when STARTED
|
||||
subject.start_build
|
||||
when CANCELED
|
||||
subject.build_canceled
|
||||
when TESTS_FAILED
|
||||
subject.tests_failed
|
||||
end
|
||||
|
||||
if !rerunning_tests && [TESTS_FAILED, COMPLETED].include?(status)
|
||||
subject.publish_container if subject.auto_create_container?
|
||||
end
|
||||
end
|
||||
when FAILED
|
||||
|
||||
case options['exit_status'].to_i
|
||||
when EXIT_CODE_UNPERMITTED_ARCHITECTURE
|
||||
subject.unpermitted_arch
|
||||
else
|
||||
subject.build_error
|
||||
end
|
||||
|
||||
item.update_attributes({status: BuildList::BUILD_ERROR}) unless rerunning_tests
|
||||
when STARTED
|
||||
subject.start_build
|
||||
when CANCELED
|
||||
item.update_attributes({status: BuildList::BUILD_CANCELED}) unless rerunning_tests || subject.tests_failed?
|
||||
subject.build_canceled
|
||||
when TESTS_FAILED
|
||||
subject.tests_failed
|
||||
end
|
||||
|
||||
if !rerunning_tests && [TESTS_FAILED, COMPLETED].include?(status)
|
||||
item.update_attributes({status: BuildList::SUCCESS})
|
||||
subject.publish_container if subject.auto_create_container?
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def find_or_create_item
|
||||
subject.items.first || subject.items.create({
|
||||
version: '',
|
||||
name: subject.project.name,
|
||||
status: BuildList::BUILD_STARTED,
|
||||
level: 0
|
||||
})
|
||||
end
|
||||
|
||||
def restart_task
|
||||
return false if status != FAILED
|
||||
if Redis.current.lrem(RESTARTED_BUILD_LISTS, 0, subject.id) > 0 || (options['results'] || []).size > 1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class AutostartBuildsDailyJob
|
||||
@queue = :low
|
||||
class AutostartBuildsDailyJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
|
||||
def self.perform
|
||||
def perform_with_ar_connection
|
||||
Product.autostart_iso_builds_once_a_day
|
||||
Project.autostart_build_lists_once_a_day
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class AutostartBuildsOnceEveryTwelveHoursJob
|
||||
@queue = :low
|
||||
class AutostartBuildsOnceEveryTwelveHoursJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
|
||||
def self.perform
|
||||
def perform_with_ar_connection
|
||||
Product.autostart_iso_builds_once_a_12_hours
|
||||
Project.autostart_build_lists_once_a_12_hours
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class AutostartBuildsWeeklyJob
|
||||
@queue = :low
|
||||
class AutostartBuildsWeeklyJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
|
||||
def self.perform
|
||||
def perform_with_ar_connection
|
||||
Product.autostart_iso_builds_once_a_week
|
||||
Project.autostart_build_lists_once_a_week
|
||||
end
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
class BaseActiveRecordJob
|
||||
def perform(*args)
|
||||
ActiveRecord::Base.connection_pool.with_connection do
|
||||
perform_with_ar_connection(*args)
|
||||
end
|
||||
ensure
|
||||
ActiveRecord::Base.clear_active_connections!
|
||||
ActiveRecord::Base.connection.close
|
||||
end
|
||||
end
|
|
@ -1,8 +1,9 @@
|
|||
module BuildLists
|
||||
class BuildCancelingDestroyJob
|
||||
@queue = :low
|
||||
class BuildCancelingDestroyJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options :queue => :low
|
||||
|
||||
def self.perform
|
||||
def perform_with_ar_connection
|
||||
scope = BuildList.for_status(BuildList::BUILD_CANCELING).for_notified_date_period(nil, 1.hours.ago)
|
||||
|
||||
scope.find_each(batch_size: 50) do |bl|
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
module BuildLists
|
||||
class CleanBuildrootJob
|
||||
@queue = :middle
|
||||
class CleanBuildrootJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options :queue => :middle
|
||||
|
||||
FILENAME = 'rpm-buildroot.tar.gz'
|
||||
|
||||
def self.perform
|
||||
def perform_with_ar_connection
|
||||
build_lists = BuildList.where(save_buildroot: true).
|
||||
for_status(BuildList::BUILD_ERROR).
|
||||
where('updated_at < ?', Time.now - 1.hour).
|
||||
|
@ -21,7 +22,9 @@ module BuildLists
|
|||
end
|
||||
end
|
||||
|
||||
def self.clean_file_store(buildroots)
|
||||
private
|
||||
|
||||
def clean_file_store(buildroots)
|
||||
buildroots.each do |r|
|
||||
FileStoreService::File.new(sha1: r['sha1']).destroy
|
||||
end
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
module BuildLists
|
||||
class ClearBuilderOnStaleBuildListsJob
|
||||
@queue = :low
|
||||
class ClearBuilderOnStaleBuildListsJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options :queue => :low
|
||||
|
||||
def self.perform
|
||||
BuildList.where(["updated_at < ?", 120.seconds.ago]).where(status: BuildList::BUILD_PENDING).find_each(batch_size: 50) do |bl|
|
||||
bl.builder = nil
|
||||
bl.save
|
||||
def perform_with_ar_connection
|
||||
BuildList.transaction do
|
||||
BuildList.where(["updated_at < ?", 120.seconds.ago]).where(status: BuildList::BUILD_PENDING).where.not(builder: nil).find_each(batch_size: 50) do |bl|
|
||||
bl.builder = nil
|
||||
bl.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
module BuildLists
|
||||
class CreateContainerJob
|
||||
@queue = :middle
|
||||
class CreateContainerJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options :queue => :middle
|
||||
|
||||
def self.perform(build_list_id)
|
||||
def perform_with_ar_connection(build_list_id)
|
||||
build_list = BuildList.find(build_list_id)
|
||||
container = AbfWorkerService::Container.new(build_list)
|
||||
container.create!
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class CleanApiDefenderStatisticsJob
|
||||
@queue = :low
|
||||
include Sidekiq::Worker
|
||||
|
||||
def self.perform
|
||||
def perform
|
||||
deadline = Date.today - 1.month
|
||||
Redis.current.keys.select do |key|
|
||||
next if key !~ /^throttle:/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class CleanRpmBuildNodeJob
|
||||
@queue = :middle
|
||||
include Sidekiq::Worker
|
||||
|
||||
def self.perform
|
||||
def perform
|
||||
RpmBuildNode.all.each do |n|
|
||||
n.delete unless n.user_id
|
||||
end
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
class CreateEmptyMetadataJob < Struct.new(:class_name, :id)
|
||||
@queue = :low
|
||||
class CreateEmptyMetadataJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options :queue => :low
|
||||
|
||||
def perform
|
||||
def perform_with_ar_connection(class_name, id)
|
||||
@id = id
|
||||
case class_name
|
||||
when Platform.name
|
||||
create_empty_metadata_for_platform
|
||||
when Repository.name
|
||||
create_empty_metadata_for_repository Repository.find(id)
|
||||
create_empty_metadata_for_repository Repository.find(@id)
|
||||
end
|
||||
end
|
||||
|
||||
def self.perform(class_name, id)
|
||||
new(class_name, id).perform
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def create_empty_metadata_for_platform
|
||||
platform = Platform.main.opened.find id
|
||||
platform = Platform.main.opened.find @id
|
||||
@platforms = [platform]
|
||||
repositories = Repository.joins(:platform).
|
||||
where(platforms: { platform_type: Platform::TYPE_PERSONAL })
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
class DestroyProjectFromRepositoryJob
|
||||
class DestroyProjectFromRepositoryJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options :queue => :low
|
||||
|
||||
def self.perform(project, repository)
|
||||
def perform_with_ar_connection(project_id, repository_id)
|
||||
project = Project.find(project_id)
|
||||
repository = Repository.find(repository_id)
|
||||
service = AbfWorkerService::Repository.new(repository)
|
||||
service.destroy_project!(project)
|
||||
end
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
class PublishTaskManagerJob
|
||||
@queue = :middle
|
||||
class PublishTaskManagerJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options :queue => :middle
|
||||
|
||||
def self.perform
|
||||
PublishTaskManagerJob.new.perform
|
||||
end
|
||||
|
||||
def perform
|
||||
def perform_with_ar_connection
|
||||
regenerate_metadata_for_software_center
|
||||
resign_repositories
|
||||
regenerate_metadata
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
class RemoveOutdatedItemsJob
|
||||
@queue = :low
|
||||
class RemoveOutdatedItemsJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options :queue => :low
|
||||
|
||||
def self.perform
|
||||
def perform_with_ar_connection
|
||||
log_file = Rails.root.join("log", "remove_outdated.log").to_s
|
||||
counter_bl = 0
|
||||
BuildList.outdated.find_each(batch_size: 100) do |bl|
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
class RunExtraMassBuildsJob
|
||||
@queue = :low
|
||||
class RunExtraMassBuildsJob < BaseActiveRecordJob
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options :queue => :low
|
||||
|
||||
def self.perform
|
||||
RunExtraMassBuildsJob.new.perform
|
||||
end
|
||||
|
||||
def perform
|
||||
def perform_with_ar_connection
|
||||
MassBuild.where(status: MassBuild::BUILD_PENDING).find_each do |mb|
|
||||
next if mb.extra_mass_builds.blank?
|
||||
emb = MassBuild.where(status: MassBuild::SUCCESS, id: mb.extra_mass_builds).to_a
|
||||
|
|
|
@ -6,7 +6,7 @@ class FeedbackMailer < ActionMailer::Base
|
|||
bcc: FBM_CONFIG['bcc']
|
||||
default_url_options.merge!(protocol: 'https') if APP_CONFIG['mailer_https_url']
|
||||
|
||||
include Resque::Mailer # send email async
|
||||
# include Resque::Mailer # send email async
|
||||
|
||||
def feedback_form_send(form_data)
|
||||
@data = Feedback.new(form_data)
|
||||
|
|
|
@ -4,7 +4,7 @@ class UserMailer < ActionMailer::Base
|
|||
default from: "\"#{APP_CONFIG['project_name']}\" <#{APP_CONFIG['do-not-reply-email']}>"
|
||||
default_url_options.merge!(protocol: 'https') if APP_CONFIG['mailer_https_url']
|
||||
|
||||
include Resque::Mailer # send email async
|
||||
# include Resque::Mailer # send email async
|
||||
|
||||
def build_list_notification(build_list, user)
|
||||
set_locale user
|
||||
|
|
|
@ -169,10 +169,6 @@ class BuildList < ActiveRecord::Base
|
|||
|
||||
state_machine :status, initial: :waiting_for_response do
|
||||
|
||||
#after_transition(on: [:place_build, :rerun_tests]) do |build_list, transition|
|
||||
#build_list.add_job_to_abf_worker_queue if build_list.external_nodes.blank?
|
||||
#end
|
||||
|
||||
after_transition on: :published,
|
||||
do: %i(set_version_and_tag actualize_packages)
|
||||
after_transition on: :publish, do: :set_publisher
|
||||
|
@ -286,7 +282,6 @@ class BuildList < ActiveRecord::Base
|
|||
end
|
||||
|
||||
later :publish, queue: :middle
|
||||
later :add_job_to_abf_worker_queue, queue: :middle
|
||||
|
||||
HUMAN_CONTAINER_STATUSES = { WAITING_FOR_RESPONSE => :waiting_for_publish,
|
||||
BUILD_PUBLISHED => :container_published,
|
||||
|
@ -571,7 +566,7 @@ class BuildList < ActiveRecord::Base
|
|||
protected
|
||||
|
||||
def create_container
|
||||
Resque.enqueue(BuildLists::CreateContainerJob, id)
|
||||
BuildLists::CreateContainerJob.perform_async(id)
|
||||
end
|
||||
|
||||
def remove_container
|
||||
|
@ -595,14 +590,14 @@ class BuildList < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def notify_users
|
||||
unless mass_build_id
|
||||
users = [user, publisher].compact.uniq.select{ |u| u.notifier.can_notify? && u.notifier.new_build? }
|
||||
#unless mass_build_id
|
||||
# users = [user, publisher].compact.uniq.select{ |u| u.notifier.can_notify? && u.notifier.new_build? }
|
||||
|
||||
users |= project.all_members(:notifier).select do |u|
|
||||
u.notifier.can_notify? && u.notifier.new_associated_build?
|
||||
end if project
|
||||
users.each{ |u| UserMailer.build_list_notification(self, u).deliver }
|
||||
end
|
||||
# users |= project.all_members(:notifier).select do |u|
|
||||
# u.notifier.can_notify? && u.notifier.new_associated_build?
|
||||
# end if project
|
||||
# users.each{ |u| UserMailer.build_list_notification(self, u).deliver }
|
||||
#end
|
||||
end # notify_users
|
||||
|
||||
def build_package(pkg_hash, package_type, prj)
|
||||
|
|
|
@ -22,8 +22,8 @@ module AbfWorkerMethods
|
|||
end
|
||||
|
||||
def add_job_to_abf_worker_queue
|
||||
Resque.push(
|
||||
worker_queue_with_priority,
|
||||
Sidekiq::Client.push(
|
||||
'queue' => worker_queue_with_priority,
|
||||
'class' => worker_queue_class,
|
||||
'args' => [abf_worker_args]
|
||||
)
|
||||
|
@ -39,11 +39,8 @@ module AbfWorkerMethods
|
|||
end
|
||||
|
||||
def destroy_from_resque_queue
|
||||
Resque::Job.destroy(
|
||||
worker_queue_with_priority,
|
||||
worker_queue_class,
|
||||
abf_worker_args
|
||||
)
|
||||
#FIX THIS
|
||||
0
|
||||
end
|
||||
|
||||
def worker_queue_with_priority(prefix = true)
|
||||
|
|
|
@ -7,7 +7,7 @@ module EmptyMetadata
|
|||
|
||||
def create_empty_metadata
|
||||
return if is_a?(Platform) && ( personal? || hidden? )
|
||||
Resque.enqueue(CreateEmptyMetadataJob, self.class.name, id)
|
||||
CreateEmptyMetadataJob.perform_async(self.class.name, id)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -310,8 +310,8 @@ class Platform < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def notify_users
|
||||
users = members.includes(:notifier).select{ |u| u.notifier.can_notify? }
|
||||
users.each{ |u| UserMailer.metadata_regeneration_notification(self, u).deliver }
|
||||
#users = members.includes(:notifier).select{ |u| u.notifier.can_notify? }
|
||||
#users.each{ |u| UserMailer.metadata_regeneration_notification(self, u).deliver }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -27,7 +27,7 @@ class ProjectToRepository < ActiveRecord::Base
|
|||
protected
|
||||
|
||||
def destroy_project_from_repository
|
||||
DestroyProjectFromRepositoryJob.perform(project, repository)
|
||||
DestroyProjectFromRepositoryJob.perform_async(project_id, repository_id)
|
||||
end
|
||||
|
||||
def one_project_in_platform_repositories
|
||||
|
|
|
@ -38,10 +38,10 @@ class AbfWorkerStatusPresenter
|
|||
|
||||
def get_status(*queues)
|
||||
status = {}
|
||||
queues.each do |worker|
|
||||
workers = Resque.workers.select{ |w| yield w, worker }
|
||||
status[worker] = status_of_worker workers, worker
|
||||
end
|
||||
#queues.each do |worker|
|
||||
# workers = Resque.workers.select{ |w| yield w, worker }
|
||||
# status[worker] = status_of_worker workers, worker
|
||||
#end
|
||||
status
|
||||
end
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ module AbfWorkerService
|
|||
return
|
||||
end
|
||||
|
||||
Resque.push(
|
||||
'publish_worker', # Low priority
|
||||
Sidekiq::Client.push(
|
||||
'queue' => 'publish_worker', # Low priority
|
||||
'class' => 'AbfWorker::PublishWorker',
|
||||
'args' => [{
|
||||
id: build_list.id,
|
||||
|
|
|
@ -10,8 +10,8 @@ module AbfWorkerService
|
|||
def regenerate!
|
||||
return unless can_regenerate?
|
||||
|
||||
Resque.push(
|
||||
'publish_worker_default',
|
||||
Sidekiq::Client.push(
|
||||
'queue' => 'publish_worker_default',
|
||||
'class' => 'AbfWorker::PublishWorkerDefault',
|
||||
'args' => [{
|
||||
id: Time.now.to_i,
|
||||
|
|
|
@ -30,8 +30,8 @@ module AbfWorkerService
|
|||
def resign!(repository_status)
|
||||
return if repository.repo_lock_file_exists?
|
||||
|
||||
Resque.push(
|
||||
'publish_worker_default',
|
||||
Sidekiq::Client.push(
|
||||
'queue' => 'publish_worker_default',
|
||||
'class' => "AbfWorker::PublishWorkerDefault",
|
||||
'args' => [{
|
||||
id: repository.id,
|
||||
|
|
|
@ -18,8 +18,8 @@ module AbfWorkerService
|
|||
system "mkdir -p #{platform_path}"
|
||||
end
|
||||
|
||||
Resque.push(
|
||||
'publish_worker_default',
|
||||
Sidekiq::Client.push(
|
||||
'queue' => 'publish_worker_default',
|
||||
'class' => 'AbfWorker::PublishWorkerDefault',
|
||||
'args' => [{
|
||||
id: Time.now.to_i,
|
||||
|
|
|
@ -206,8 +206,8 @@ module AbfWorkerService
|
|||
end
|
||||
|
||||
def push(options)
|
||||
Resque.push(
|
||||
'publish_worker_default',
|
||||
Sidekiq::Client.push(
|
||||
'queue' => 'publish_worker_default',
|
||||
'class' => 'AbfWorker::PublishWorkerDefault',
|
||||
'args' => [options]
|
||||
)
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
div ng-if="false"
|
||||
|
|
@ -9,50 +9,37 @@ html
|
|||
= auto_discovery_link_tag :atom, atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token), title: t("layout.atom_link_tag_title", nickname: current_user.uname, app_name: APP_CONFIG['project_name'])
|
||||
script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js" type="text/javascript"
|
||||
link href='//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' rel='stylesheet'
|
||||
link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"
|
||||
link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'
|
||||
== stylesheet_link_tag 'new_application', cache: 'application'
|
||||
|
||||
body[ ng-app='RosaABF' ng-controller='RosaABFController' ng-strict-di=''
|
||||
ng-init="init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" ng-cloak="true"]
|
||||
.page-wrapper.open
|
||||
.page-wrapper ng-class="{'open': toggle}"
|
||||
.sidebar-wrapper
|
||||
ul.sidebar
|
||||
li.sidebar-main
|
||||
a href="/"
|
||||
= link_to image_tag('logo-mini.png', alt: 'ABF'), root_path
|
||||
a ng-click="toggleSidebar()"
|
||||
= image_tag('logo-mini.png', alt: 'ABF')
|
||||
span class="menu-icon glyphicon glyphicon-transfer"
|
||||
== render 'layouts/menu/new_top'
|
||||
== render 'layouts/menu/new_bottom'
|
||||
|
||||
.content-wrapper
|
||||
.page-content
|
||||
.row.header
|
||||
.col-md-12
|
||||
.user.pull-right
|
||||
- if current_user
|
||||
.item.dropdown(uib-dropdown)
|
||||
a(uib-dropdown-toggle)
|
||||
= image_tag avatar_url(current_user), alt: 'avatar'
|
||||
ul.dropdown-menu.dropdown-menu-right
|
||||
li.link= link_to current_user.uname, current_user
|
||||
li.link= link_to t('layout.settings.label'), profile_settings_path
|
||||
li.divider
|
||||
li.link= link_to t('layout.logout'), destroy_user_session_path, method: :delete
|
||||
- else
|
||||
ul.nav.navbar-nav
|
||||
li= link_to t('layout.devise.shared_links.sign_up'), new_user_registration_path
|
||||
li= link_to t('layout.devise.shared_links.sign_in'), new_user_session_path
|
||||
.meta
|
||||
.page
|
||||
== yield :submenu if content_for?(:submenu)
|
||||
== render 'layouts/noscript'
|
||||
== render "layouts/flashes"
|
||||
|
||||
== yield
|
||||
|
||||
|
||||
script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js" type="text/javascript"
|
||||
script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js" type="text/javascript"
|
||||
script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-resource.js" type="text/javascript"
|
||||
script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-cookies.js" type="text/javascript"
|
||||
script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-sanitize.js" type="text/javascript"
|
||||
script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.2.5/ui-bootstrap-tpls.js" type="text/javascript"
|
||||
script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-resource.min.js" type="text/javascript"
|
||||
script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-cookies.min.js" type="text/javascript"
|
||||
script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-sanitize.min.js" type="text/javascript"
|
||||
script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.2.5/ui-bootstrap-tpls.min.js" type="text/javascript"
|
||||
script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous"
|
||||
== javascript_include_tag 'new_application', cache: 'application'
|
||||
== yield :additional_scripts if content_for?(:additional_scripts)
|
||||
|
|
|
@ -7,118 +7,119 @@
|
|||
- product = pbl.product
|
||||
- platform = product.platform
|
||||
|
||||
.row ng-controller='ProductBuildListController' ng-init=("init("+pbl.id.to_s+")")
|
||||
.col-md-6
|
||||
rd-widget
|
||||
rd-widget-header title=t('layout.product_build_lists.main_data')
|
||||
rd-widget-body class="no-padding"
|
||||
table.table.table-condensed
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.id')
|
||||
td
|
||||
= pbl.id
|
||||
div ng-init=("init("+pbl.id.to_s+")") ng-controller='ProductBuildListController'
|
||||
.row
|
||||
.col-md-6
|
||||
rd-widget
|
||||
rd-widget-header title=t('layout.product_build_lists.main_data')
|
||||
rd-widget-body class="no-padding"
|
||||
table.table.table-condensed
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.id')
|
||||
td
|
||||
= pbl.id
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.status')
|
||||
td
|
||||
| {{pbl.human_status}}
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.status')
|
||||
td
|
||||
| {{pbl.human_status}}
|
||||
|
||||
- if pbl.user
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.user')
|
||||
td
|
||||
= link_to pbl.user.try(:fullname), pbl.user
|
||||
- if pbl.user
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.user')
|
||||
td
|
||||
= link_to pbl.user.try(:fullname), pbl.user
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.product')
|
||||
td
|
||||
= link_to pbl.product.name, platform_product_path(platform, product)
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.product')
|
||||
= t('activerecord.attributes.product_build_list.project')
|
||||
td
|
||||
= link_to pbl.product.name, platform_product_path(platform, product)
|
||||
= link_to pbl.project.name_with_owner, project_build_lists_path(pbl.project)
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.project')
|
||||
td
|
||||
= link_to pbl.project.name_with_owner, project_build_lists_path(pbl.project)
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.project_version')
|
||||
td
|
||||
= product_build_list_version_link(pbl, true)
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.main_script')
|
||||
td
|
||||
= pbl.main_script
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.params')
|
||||
td
|
||||
= pbl.params
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.time_living')
|
||||
td
|
||||
= pbl.time_living / 60
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.autostarted')
|
||||
td
|
||||
= t("layout.#{pbl.autostarted}_")
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.notified_at')
|
||||
td
|
||||
| {{pbl.notified_at}}
|
||||
|
||||
- if policy(pbl).update?
|
||||
tr ng-show="pbl.status == #{ ProductBuildList::BUILD_COMPLETED }"
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.not_delete')
|
||||
= t('activerecord.attributes.product_build_list.project_version')
|
||||
td
|
||||
= select_tag 'not_delete',
|
||||
options_for_select(product_build_list_delete_options),
|
||||
{ ng_model: "pbl.not_delete", ng_change: 'updateStatus()'}
|
||||
.row.alert.alert-danger.top-space ng-hide='pbl.not_delete != "false"'
|
||||
- days = pbl.autostarted? ? ProductBuildList::LIVE_TIME : ProductBuildList::MAX_LIVE_TIME
|
||||
- days = (pbl.created_at.to_date - days.ago.to_date).to_i
|
||||
- if days > 1
|
||||
= t('layout.product_build_lists.will_be_removed_n_days', n: days)
|
||||
- else
|
||||
= t('layout.product_build_lists.will_be_removed_today')
|
||||
= product_build_list_version_link(pbl, true)
|
||||
|
||||
- if policy(pbl).cancel? || policy(pbl).destroy?
|
||||
rd-widget-footer ng-show="pbl.can_cancel || pbl.can_destroy"
|
||||
- if policy(pbl).cancel?
|
||||
a.btn.btn-warning[
|
||||
href=cancel_platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl)
|
||||
data-method = 'put'
|
||||
data-confirm = t('layout.confirm')
|
||||
ng-show = 'pbl.can_cancel' ]
|
||||
= t('layout.build_lists.cancel')
|
||||
|
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.main_script')
|
||||
td
|
||||
= pbl.main_script
|
||||
|
||||
- if policy(pbl).destroy?
|
||||
a.btn.btn-danger[
|
||||
href=platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl)
|
||||
data-method = 'delete'
|
||||
data-confirm = t('layout.confirm')
|
||||
ng-show = 'pbl.can_destroy' ]
|
||||
= t('layout.product_build_lists.delete')
|
||||
.col-md-6
|
||||
= render 'shared/build_results', subject: pbl
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.params')
|
||||
td
|
||||
= pbl.params
|
||||
|
||||
.row ng-show="pbl.status == #{ProductBuildList::BUILD_STARTED}"
|
||||
.col-md-12
|
||||
= render 'shared/log', { build_started: true, get_log_path: log_platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl) }
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.time_living')
|
||||
td
|
||||
= pbl.time_living / 60
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.autostarted')
|
||||
td
|
||||
= t("layout.#{pbl.autostarted}_")
|
||||
|
||||
tr
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.notified_at')
|
||||
td
|
||||
| {{pbl.notified_at}}
|
||||
|
||||
- if policy(pbl).update?
|
||||
tr ng-show="pbl.status == #{ ProductBuildList::BUILD_COMPLETED }"
|
||||
td
|
||||
= t('activerecord.attributes.product_build_list.not_delete')
|
||||
td
|
||||
= select_tag 'not_delete',
|
||||
options_for_select(product_build_list_delete_options),
|
||||
{ ng_model: "pbl.not_delete", ng_change: 'updateStatus()'}
|
||||
.row.alert.alert-danger.top-space ng-hide='pbl.not_delete != "false"'
|
||||
- days = pbl.autostarted? ? ProductBuildList::LIVE_TIME : ProductBuildList::MAX_LIVE_TIME
|
||||
- days = (pbl.created_at.to_date - days.ago.to_date).to_i
|
||||
- if days > 1
|
||||
= t('layout.product_build_lists.will_be_removed_n_days', n: days)
|
||||
- else
|
||||
= t('layout.product_build_lists.will_be_removed_today')
|
||||
|
||||
- if policy(pbl).cancel? || policy(pbl).destroy?
|
||||
rd-widget-footer ng-show="pbl.can_cancel || pbl.can_destroy"
|
||||
- if policy(pbl).cancel?
|
||||
a.btn.btn-warning[
|
||||
href=cancel_platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl)
|
||||
data-method = 'put'
|
||||
data-confirm = t('layout.confirm')
|
||||
ng-show = 'pbl.can_cancel' ]
|
||||
= t('layout.build_lists.cancel')
|
||||
|
|
||||
|
||||
- if policy(pbl).destroy?
|
||||
a.btn.btn-danger[
|
||||
href=platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl)
|
||||
data-method = 'delete'
|
||||
data-confirm = t('layout.confirm')
|
||||
ng-show = 'pbl.can_destroy' ]
|
||||
= t('layout.product_build_lists.delete')
|
||||
.col-md-6
|
||||
= render 'shared/build_results', subject: pbl
|
||||
|
||||
.row.top-space ng-show="pbl.status == #{ProductBuildList::BUILD_STARTED}"
|
||||
.col-md-12
|
||||
= render 'shared/log', { build_started: true, get_log_path: log_platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl) }
|
||||
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
require 'resque/server'
|
||||
require 'resque/status_server'
|
||||
require 'resque_scheduler'
|
||||
require 'resque_scheduler/server'
|
||||
#require 'resque/server'
|
||||
#require 'resque/status_server'
|
||||
#require 'resque_scheduler'
|
||||
#require 'resque_scheduler/server'
|
||||
|
||||
::ResqueServer = ::Resque::Server # need for CanCan
|
||||
#::ResqueServer = ::Resque::Server # need for CanCan
|
||||
|
||||
Resque::Mailer.default_queue_name = :notification
|
||||
Resque::Mailer.excluded_environments = [:test]
|
||||
#Resque::Mailer.default_queue_name = :notification
|
||||
#Resque::Mailer.excluded_environments = [:test]
|
||||
|
||||
unless Rails.env.test?
|
||||
PerformLater.config.enabled = true # this will default to false if unset
|
||||
end
|
||||
#unless Rails.env.test?
|
||||
# PerformLater.config.enabled = true # this will default to false if unset
|
||||
#end
|
||||
|
||||
Resque::Plugins::Status::Hash.expire_in = (24 * 60 * 60) # 24hrs in seconds
|
||||
#Resque::Plugins::Status::Hash.expire_in = (24 * 60 * 60) # 24hrs in seconds
|
|
@ -0,0 +1,11 @@
|
|||
require 'sidekiq/scheduler'
|
||||
|
||||
Kiqit.config.enabled = true
|
||||
|
||||
Sidekiq.configure_server do |config|
|
||||
config.on(:startup) do
|
||||
Sidekiq.schedule = YAML
|
||||
.load_file(File.expand_path('../../../config/schedule.yml', __FILE__))
|
||||
Sidekiq::Scheduler.reload_schedule!
|
||||
end
|
||||
end
|
|
@ -1,3 +1,6 @@
|
|||
require 'sidekiq/web'
|
||||
require 'sidekiq-scheduler/web'
|
||||
|
||||
Rails.application.routes.draw do
|
||||
|
||||
# ActiveAdmin routes.
|
||||
|
@ -5,7 +8,7 @@ Rails.application.routes.draw do
|
|||
|
||||
namespace :admin do
|
||||
constraints Rosa::Constraints::AdminAccess do
|
||||
mount Resque::Server => 'resque'
|
||||
mount Sidekiq::Web => 'sidekiq'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
Binary file not shown.
After Width: | Height: | Size: 556 KiB |
|
@ -1,23 +0,0 @@
|
|||
namespace :resque do
|
||||
desc 'Stop all Resque workers'
|
||||
task stop_workers: :environment do
|
||||
pids = []
|
||||
Resque.workers.each do |worker|
|
||||
pids << worker.to_s.split(/:/).second
|
||||
end
|
||||
system("kill -QUIT #{pids.join(' ')}") if pids.size > 0
|
||||
end
|
||||
|
||||
# This fixes connection fail with Postgres server on new fork:
|
||||
task setup: :environment do
|
||||
Resque.after_fork do
|
||||
Resque.redis.client.reconnect
|
||||
end
|
||||
Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }
|
||||
end
|
||||
|
||||
task scheduler_setup: :environment do
|
||||
Resque.schedule = YAML.load_file(Rails.root.join('config', 'resque_schedule.yml'))
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue