resque-await-migration 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9880482f140f4ecc546da3c3ee85f2e6123209610c3a26ecf1172055d6bb2b54
|
4
|
+
data.tar.gz: e9bca36c36d55929379611918367d8029f2a9dab4e9ef08802763cb9132ef3e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35a004a83e68059da6060d1031bb4c48193f2cc3cb7189422a48b2ffc8eff3711393082ecd3326353a9f5fadf2fd95a817cf1fcc0ba3650704ba6ba5205b4ccf
|
7
|
+
data.tar.gz: 33f1748c8645092e1b65f7a0c180752a0cc3c127cad487859ce8d0bba9b13501e2cab241e08bbd620c9b0f88d0a208f2f41a193edcf9f35a7d4d2b1a584ccea7
|
@@ -26,8 +26,8 @@ module Resque
|
|
26
26
|
|
27
27
|
def check_in_forked(parent_pid)
|
28
28
|
|
29
|
-
interval = ENV['INTERVAL'] || 5
|
30
|
-
timeout_limit = ENV['AWAIT_MIGRATION_LIMIT'] || 60 * 60 # 60 minutes
|
29
|
+
interval = ENV['INTERVAL']&.to_i || 5
|
30
|
+
timeout_limit = ENV['AWAIT_MIGRATION_LIMIT']&.to_i || 60 * 60 # 60 minutes
|
31
31
|
usr2_was_sent_at = Time.now.to_i
|
32
32
|
|
33
33
|
_info_log "Migration is needed. Send signal:USR2 to PID:#{parent_pid}"
|
@@ -10,8 +10,14 @@ module Resque
|
|
10
10
|
Resque::Await::Migration::Controller.start
|
11
11
|
end
|
12
12
|
|
13
|
-
Resque.worker_exit
|
14
|
-
Resque
|
13
|
+
if Resque.respond_to?(:worker_exit)
|
14
|
+
Resque.worker_exit do
|
15
|
+
Resque::Await::Migration::Controller.stop_if_alive
|
16
|
+
end
|
17
|
+
else
|
18
|
+
Kernel.at_exit do
|
19
|
+
Resque::Await::Migration::Controller.stop_if_alive
|
20
|
+
end
|
15
21
|
end
|
16
22
|
end
|
17
23
|
module_function :setup
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-await-migration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bizside-developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resque
|
@@ -98,7 +98,6 @@ files:
|
|
98
98
|
- lib/resque/await/migration.rb
|
99
99
|
- lib/resque/await/migration/controller.rb
|
100
100
|
- lib/resque/await/migration/version.rb
|
101
|
-
- lib/tasks/check_migration.rake
|
102
101
|
homepage: https://github.com/maedadev/resque-await-migration
|
103
102
|
licenses:
|
104
103
|
- MIT
|
@@ -1,17 +0,0 @@
|
|
1
|
-
|
2
|
-
namespace :resque_await_migration do
|
3
|
-
desc "マイグレーションチェックする処理を実行します"
|
4
|
-
task :check_migration => :environment do
|
5
|
-
pid = ENV['ORIGIN_PID']
|
6
|
-
helper = Resque::Await::Migration::ResqueHelper.new
|
7
|
-
helper.check_migration(pid)
|
8
|
-
end
|
9
|
-
|
10
|
-
task :beforeJob => :environment do
|
11
|
-
puts "バックグラウンド処理を実行します"
|
12
|
-
sh "ORIGIN_PID=#{$$} bundle exec rake resque_await_migration:check_migration &"
|
13
|
-
puts "バックグラウンド処理を実行しました"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
Rake::Task[:'resque:work'].enhance([:'resque_await_migration:beforeJob'])
|