Skip to content

Commit

Permalink
Added sidetiq and removed crono
Browse files Browse the repository at this point in the history
  • Loading branch information
Joeper214 committed Aug 17, 2016
1 parent 40d2507 commit a6723b8
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 17 deletions.
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ gem 'serverspec', require: false # serverspec is used only by rake serverspec
gem 'specinfra', require: false
gem 'highline'
gem 'sidekiq', "~> 3.4.2" # for Active Job
gem 'sidekiq-scheduler' # for Scheduled Job
gem 'sidetiq' # for Scheduled Job
gem 'foreman', require: false

gem "bootstrap-table-rails"
Expand All @@ -75,8 +75,7 @@ group :development, :test do
gem "awesome_print"
gem 'rack-contrib'
gem 'ruby-prof'
gem 'xray-rails'

gem 'sinatra', require: false
gem 'quiet_assets'

# test
Expand Down
25 changes: 13 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ GEM
i18n (0.7.0)
i18n-js (2.1.2)
i18n
ice_cube (0.11.1)
iniparse (1.4.2)
ipaddress (0.8.3)
jbuilder (2.6.0)
Expand Down Expand Up @@ -305,6 +306,8 @@ GEM
rack-contrib (1.4.0)
git-version-bump (~> 0.15)
rack (~> 1.4)
rack-protection (1.5.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
railroady (1.5.1)
Expand Down Expand Up @@ -425,7 +428,6 @@ GEM
ruby_dep (1.3.1)
rubyntlm (0.6.0)
rubyzip (1.2.0)
rufus-scheduler (3.1.10)
sass (3.4.22)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
Expand All @@ -450,17 +452,19 @@ GEM
json (~> 1.0)
redis (~> 3.2, >= 3.2.1)
redis-namespace (~> 1.5, >= 1.5.2)
sidekiq-scheduler (2.0.8)
multi_json (~> 1)
redis (~> 3)
rufus-scheduler (~> 3.1.8)
sidekiq (>= 3)
tilt (>= 1.4.0)
sidetiq (0.6.3)
celluloid (>= 0.14.1)
ice_cube (= 0.11.1)
sidekiq (>= 3.0.0)
simplecov (0.12.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sinatra (1.4.7)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
sky_zabbix (2.2.0.1.2)
slop (3.6.0)
specinfra (2.60.4)
Expand Down Expand Up @@ -524,9 +528,6 @@ GEM
nori (~> 2.0)
rubyntlm (~> 0.6.0)
wmi-lite (1.0.0)
xray-rails (0.1.21)
coffee-rails
rails (>= 3.1.0)
yard (0.9.5)

PLATFORMS
Expand Down Expand Up @@ -594,7 +595,8 @@ DEPENDENCIES
sdoc
serverspec
sidekiq (~> 3.4.2)
sidekiq-scheduler
sidetiq
sinatra
sky_zabbix (~> 2.2.0)
specinfra
spring
Expand All @@ -607,7 +609,6 @@ DEPENDENCIES
therubyracer
uglifier
unicorn-rails
xray-rails
yard

BUNDLED WITH
Expand Down
1 change: 0 additions & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
job: bundle exec sidekiq
web: bin/rails server -b127.0.0.1
worker: bundle exec crono -P tmp/pids/crono.pid
ws: ./bin/ws_proxy
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ module.exports = Vue.extend({
id: item,
};
});
console.log(self.data);

self.$parent.loading = false;
$("#loading_results").hide();
Expand Down
8 changes: 7 additions & 1 deletion app/jobs/operation_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
# http://opensource.org/licenses/mit-license.php
#

class Operation_worker
class OperationWorker
include Sidekiq::Worker
include Sidetiq::Schedulable

recurrence backfill: true do
minutely(3)
end

def perform

Expand Down
6 changes: 6 additions & 0 deletions app/jobs/server_state_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
#

class ServerStateWorker < ActiveJob::Base
include Sidetiq::Schedulable

recurrence backfill: true do
minutely(5)
end

def perform(*params)
kinds =
if params.empty?
Expand Down
4 changes: 4 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
SkyHopper::Application.routes.draw do
require 'sidekiq/web'
require 'sidetiq/web'
mount Sidekiq::Web => '/sidekiq'

resources :zabbix_servers
resources :users_admin, except: :show do
collection do
Expand Down

0 comments on commit a6723b8

Please sign in to comment.