Created
December 20, 2020 16:58
-
-
Save kamillle/96fce98ff1a9349c26d70ac66d3159d2 to your computer and use it in GitHub Desktop.
Let you know sidekiq heartbeat is volatilized in 60 secs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[29] pry(main)> def monitor | |
[29] pry(main)* time = 0 | |
[29] pry(main)* loop do | |
[29] pry(main)* puts "#{time} 秒経ちました" | |
[29] pry(main)* unless Sidekiq::ProcessSet.new.first.present? | |
[29] pry(main)* puts 'heartbeatが揮発しました' | |
[29] pry(main)* break | |
[29] pry(main)* end | |
[29] pry(main)* puts Sidekiq::ProcessSet.new.first.inspect | |
[29] pry(main)* sleep 10 | |
[29] pry(main)* time += 10 | |
[29] pry(main)* end | |
[29] pry(main)* end | |
=> :monitor | |
# run `kill -9 PID_OF_SIDEKIQ` | |
[30] pry(main)> monitor | |
0 秒経ちました | |
#<Sidekiq::Process:0x00007fb1d811e9f0 @attribs={"hostname"...}> | |
10 秒経ちました | |
#<Sidekiq::Process:0x00007fb1d812ea58 @attribs={"hostname"...}> | |
20 秒経ちました | |
#<Sidekiq::Process:0x00007fb22ef3a678 @attribs={"hostname"...}> | |
30 秒経ちました | |
#<Sidekiq::Process:0x00007fb22ef420f8 @attribs={"hostname"...}> | |
40 秒経ちました | |
#<Sidekiq::Process:0x00007fb1cf87ce30 @attribs={"hostname"...}> | |
50 秒経ちました | |
#<Sidekiq::Process:0x00007fb1cf88c178 @attribs={"hostname"...}> | |
60 秒経ちました | |
heartbeatが揮発しました |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment