removed sleep() line. added time to trace output. sorting files by size

This commit is contained in:
Nick Gauthier 2010-02-05 16:20:26 -05:00
parent 3b5ddec6a7
commit b1989dd8fc
3 changed files with 2 additions and 2 deletions

View File

@ -23,6 +23,7 @@ module Hydra #:nodoc:
opts.merge!(YAML.load_file(config_file).stringify_keys!)
end
@files = opts.fetch('files') { [] }
@files.sort!{|a,b| File.size(b) <=> File.size(a)} # dumb heuristic
@incomplete_files = @files.dup
@workers = []
@listeners = []

View File

@ -16,7 +16,7 @@ module Hydra #:nodoc:
# Trace some output with the class's prefix and a newline.
# Checks to ensure we're running verbosely.
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

View File

@ -139,7 +139,6 @@ module Hydra #:nodoc:
idle_r = nil
while idle_r.nil?
idle_r = @runners.detect{|runner| runner[:idle]}
sleep(1)
end
return idle_r
end