resque-await-migration 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56f8cf84358b4fa5c1773af7645d46f62acda79aefc2fb25563f5d3258dd974f
4
- data.tar.gz: bea23dd7eb4a03147d68b4885900032603089352e8bb1a8d32481c9989da66aa
3
+ metadata.gz: 9880482f140f4ecc546da3c3ee85f2e6123209610c3a26ecf1172055d6bb2b54
4
+ data.tar.gz: e9bca36c36d55929379611918367d8029f2a9dab4e9ef08802763cb9132ef3e7
5
5
  SHA512:
6
- metadata.gz: a58901ba51c76227b186bd1da0b5d8eaa5c7c13d854ecfc35a843a2478a4c1570403325774e9db7d5168afe9da029123e985078ce6ed75a5322ecadedc6c4189
7
- data.tar.gz: 73edfa5ead862a4d008d7867772353832106ecd3e377de05e2e047a99e4ac5156d861f7119bf09f8514596e32efd88345e1a8b1c03b8207ce33547c6409592d4
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}"
@@ -1,7 +1,7 @@
1
1
  module Resque
2
2
  module Await
3
3
  module Migration
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
6
6
  end
7
7
  end
@@ -10,8 +10,14 @@ module Resque
10
10
  Resque::Await::Migration::Controller.start
11
11
  end
12
12
 
13
- Resque.worker_exit do
14
- Resque::Await::Migration::Controller.stop_if_alive
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.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-08 00:00:00.000000000 Z
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'])