zold 0.13.15 → 0.13.16

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
  SHA1:
3
- metadata.gz: ee79ed1a6d5050ca1df7ced93d9bf5f2b488c160
4
- data.tar.gz: 1a01a16eaa9006a2c82a7142d918d3acddf24e7d
3
+ metadata.gz: 3183919e57351739619bf518c2870c25ec473985
4
+ data.tar.gz: 67635b036d23a07bf3f1d92d4c6b4513b3c9748f
5
5
  SHA512:
6
- metadata.gz: 6aac2cf9156a6c3439a610419256a4f5a2c4f19dc0a594b29b29b10a816a5eacaf5ea1406b8f5631af384dc0fbeb5395bb9533242c6d033630787a8f2a5c07b8
7
- data.tar.gz: 72c085b6d56e2f19340906c3d106079f406c33709b5bdb47ea40b3e1151f1e0fb91ca92ada87869e482f32eb221f675090cbe56a503f3fc101218c52919d2536
6
+ metadata.gz: 75dfb39205b5b048471e8589462ca9dbf6607930077fdd649a80f2356bd5e7a10c35fd3064ed239bbb9f642b88eb039ac3d8c43e76b2bb36c43345169789943d
7
+ data.tar.gz: 7ead05305c2aa61831803d031c1bd0da5dfa24894598a1a96d789cc2a6dc45b452aaba2e2daace99ba423767656546431386f9b7c37d768b72cf59571a29c44a
data/bin/zold CHANGED
@@ -23,9 +23,11 @@
23
23
 
24
24
  STDOUT.sync = true
25
25
 
26
- # For debug in production, see https://github.com/frsyuki/sigdump
27
- ENV['SIGDUMP_PATH'] = File.join(Dir.pwd, "sigdump-#{Process.pid}.log")
28
- require 'sigdump/setup'
26
+ unless Gem.win_platform?
27
+ # For debug in production, see https://github.com/frsyuki/sigdump
28
+ ENV['SIGDUMP_PATH'] = File.join(Dir.pwd, "sigdump-#{Process.pid}.log")
29
+ require 'sigdump/setup'
30
+ end
29
31
 
30
32
  require 'slop'
31
33
  require 'rainbow'
@@ -170,6 +170,7 @@ module Zold
170
170
 
171
171
  private
172
172
 
173
+ # Returns exit code
173
174
  def exec(cmd, nohup_log)
174
175
  Open3.popen2e(cmd) do |stdin, stdout, thr|
175
176
  start = Time.now
@@ -187,7 +188,7 @@ module Zold
187
188
  code = thr.value.to_i
188
189
  nohup_log.print("Exit code of process ##{thr.pid} is #{code}, was alive for \
189
190
  #{((Time.now - start) / 60).round} min: #{cmd}\n")
190
- raise unless code.zero?
191
+ code
191
192
  end
192
193
  end
193
194
 
@@ -205,7 +206,11 @@ module Zold
205
206
  args = ARGV.delete_if { |a| a.start_with?('--nohup', '--home') }
206
207
  loop do
207
208
  begin
208
- exec("#{myself} #{args.join(' ')}", nohup_log)
209
+ code = exec("#{myself} #{args.join(' ')}", nohup_log)
210
+ if code != 0
211
+ nohup_log.print("Let's wait for a minutes, because of the failure...")
212
+ sleep(60)
213
+ end
209
214
  exec(opts['nohup-command'], nohup_log)
210
215
  rescue StandardError => e
211
216
  nohup_log.print(Backtrace.new(e).to_s)
@@ -42,9 +42,9 @@ module Zold
42
42
  VerboseThread.new(@log).run(true) do
43
43
  routine.exec(step)
44
44
  end
45
- sleep(1)
46
45
  step += 1
47
- @log.debug("Routine #{routine.class.name} ##{step} done in #{(Time.now - start).round(2)}s")
46
+ @log.info("Routine #{routine.class.name} ##{step} done in #{(Time.now - start).round(2)}s")
47
+ sleep(1)
48
48
  end
49
49
  end
50
50
  @log.info("Added #{routine.class.name} to the metronome")
data/lib/zold/version.rb CHANGED
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Zold
26
- VERSION = '0.13.15'.freeze
26
+ VERSION = '0.13.16'.freeze
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.15
4
+ version: 0.13.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko