removed sleep() line. added time to trace output. sorting files by size
This commit is contained in:
parent
3b5ddec6a7
commit
b1989dd8fc
|
@ -23,6 +23,7 @@ module Hydra #:nodoc:
|
||||||
opts.merge!(YAML.load_file(config_file).stringify_keys!)
|
opts.merge!(YAML.load_file(config_file).stringify_keys!)
|
||||||
end
|
end
|
||||||
@files = opts.fetch('files') { [] }
|
@files = opts.fetch('files') { [] }
|
||||||
|
@files.sort!{|a,b| File.size(b) <=> File.size(a)} # dumb heuristic
|
||||||
@incomplete_files = @files.dup
|
@incomplete_files = @files.dup
|
||||||
@workers = []
|
@workers = []
|
||||||
@listeners = []
|
@listeners = []
|
||||||
|
|
|
@ -16,7 +16,7 @@ module Hydra #:nodoc:
|
||||||
# Trace some output with the class's prefix and a newline.
|
# Trace some output with the class's prefix and a newline.
|
||||||
# Checks to ensure we're running verbosely.
|
# Checks to ensure we're running verbosely.
|
||||||
def trace(str)
|
def trace(str)
|
||||||
$stdout.write "#{self.class._traceable_prefix}| #{str}\n" if @verbose
|
$stdout.write "#{Time.now.to_f} #{self.class._traceable_prefix}| #{str}\n" if @verbose
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -139,7 +139,6 @@ module Hydra #:nodoc:
|
||||||
idle_r = nil
|
idle_r = nil
|
||||||
while idle_r.nil?
|
while idle_r.nil?
|
||||||
idle_r = @runners.detect{|runner| runner[:idle]}
|
idle_r = @runners.detect{|runner| runner[:idle]}
|
||||||
sleep(1)
|
|
||||||
end
|
end
|
||||||
return idle_r
|
return idle_r
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue