spinnaker-sidekiq 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -7
- data/app/controllers/spinnaker/sidekiq/api_controller.rb +10 -1
- data/config/routes.rb +2 -0
- data/lib/spinnaker/sidekiq/version.rb +1 -1
- data/lib/spinnaker/sidekiq.rb +10 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3315429bd29ee38d63ee6087f1d05e9492afed621ee5983ee45444c876763922
|
4
|
+
data.tar.gz: 64448a375557180ce8b2c42f5ceef57e2c1e7fd020babfdff2dfd3655e7cde11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb29e4d5adc141ffe5c115ea4c4f6ba78ceca6b57265d95276e18d6d5c108101e9d4350d19c241b2d5fcd86d892b94aab6aba766de43b75da134106a73e1e7f0
|
7
|
+
data.tar.gz: a6962a7b5075e30b23804f7e47f27af45c71fbca3c5ddf9d2140701b4a1faeb44e4fbb54e18678c6accfab7e01ee4bba5324ae95acd2636379cebcee44e58c72
|
data/Rakefile
CHANGED
@@ -1,8 +1,4 @@
|
|
1
|
-
|
2
|
-
require "bundler/setup"
|
3
|
-
rescue LoadError
|
4
|
-
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
5
|
-
end
|
1
|
+
require "bundler/setup"
|
6
2
|
|
7
3
|
require "rdoc/task"
|
8
4
|
|
@@ -14,13 +10,12 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
14
10
|
rdoc.rdoc_files.include("lib/**/*.rb")
|
15
11
|
end
|
16
12
|
|
17
|
-
APP_RAKEFILE = File.expand_path("
|
13
|
+
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
18
14
|
load "rails/tasks/engine.rake"
|
19
15
|
|
20
16
|
load "rails/tasks/statistics.rake"
|
21
17
|
|
22
18
|
require "bundler/gem_tasks"
|
23
|
-
|
24
19
|
require "rake/testtask"
|
25
20
|
|
26
21
|
require "standard/rake"
|
@@ -26,11 +26,20 @@ module Spinnaker
|
|
26
26
|
|
27
27
|
busy_jobs = processes.sum { |process| process["busy"] }
|
28
28
|
|
29
|
-
status = busy_jobs == 0 ? "quiet" : "busy"
|
29
|
+
status = (busy_jobs == 0) ? "quiet" : "busy"
|
30
30
|
|
31
31
|
render json: {status: status, progress: "Pending jobs: #{busy_jobs}"}
|
32
32
|
end
|
33
33
|
|
34
|
+
def terminate_all
|
35
|
+
ps = ::Sidekiq::ProcessSet.new
|
36
|
+
ps.each(&:quiet!)
|
37
|
+
::Sidekiq.redis { |conn|
|
38
|
+
conn.publish("sidekiq:terminate", Time.now.to_i)
|
39
|
+
}
|
40
|
+
render plain: "Terminate signal sent to Sidekiq workers"
|
41
|
+
end
|
42
|
+
|
34
43
|
private
|
35
44
|
|
36
45
|
def authenticate
|
data/config/routes.rb
CHANGED
data/lib/spinnaker/sidekiq.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "spinnaker/sidekiq/version"
|
1
2
|
require "spinnaker/sidekiq/engine"
|
2
3
|
|
3
4
|
module Spinnaker
|
@@ -9,11 +10,19 @@ module Spinnaker
|
|
9
10
|
end
|
10
11
|
|
11
12
|
class << self
|
12
|
-
attr_writer :api_token
|
13
|
+
attr_writer :api_token, :shutdown_signal_ttl, :terminate_callback
|
13
14
|
|
14
15
|
def api_token
|
15
16
|
@api_token ||= ENV.fetch("SPINNAKER_SIDEKIQ_API_TOKEN") { raise MissingApiToken }
|
16
17
|
end
|
18
|
+
|
19
|
+
def shutdown_signal_ttl
|
20
|
+
@shutdown_signal_ttl ||= ENV.fetch("SPINNAKER_SIDEKIQ_SHUTDOWN_SIGNAL_TTL", 30).to_i
|
21
|
+
end
|
22
|
+
|
23
|
+
def terminate_callback
|
24
|
+
@terminate_callback || raise("terminate_callback not set")
|
25
|
+
end
|
17
26
|
end
|
18
27
|
end
|
19
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spinnaker-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jorge Dias
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -116,7 +116,7 @@ homepage: https://github.com/intellum/spinnaker-sidekiq
|
|
116
116
|
licenses:
|
117
117
|
- MIT
|
118
118
|
metadata: {}
|
119
|
-
post_install_message:
|
119
|
+
post_install_message:
|
120
120
|
rdoc_options: []
|
121
121
|
require_paths:
|
122
122
|
- lib
|
@@ -131,9 +131,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
|
-
|
135
|
-
|
136
|
-
signing_key:
|
134
|
+
rubygems_version: 3.2.33
|
135
|
+
signing_key:
|
137
136
|
specification_version: 4
|
138
137
|
summary: Spinnaker Sidekiq integration
|
139
138
|
test_files: []
|