Class: Typhoeus::Hydra

Inherits:
Object
  • Object
show all
Defined in:
lib/lazy_resource/ext/typhoeus.rb

Instance Method Summary collapse

Instance Method Details

#run_with_loggingObject Also known as: run



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/lazy_resource/ext/typhoeus.rb', line 3

def run_with_logging
  log = LazyResource.debug && LazyResource.logger && @multi.active > 0 && @multi.running <= 0
  if log
    LazyResource.logger.info "Processing requests:"
    start_time = Time.now
  end

  run_without_logging

  if log
    LazyResource.logger.info "Requests processed in #{((Time.now - start_time) * 1000).ceil}ms"
  end
end