Class: Typhoeus::Hydra
- Inherits:
-
Object
- Object
- Typhoeus::Hydra
- Defined in:
- lib/lazy_resource/ext/typhoeus.rb
Instance Method Summary collapse
- #run_with_logging ⇒ Object (also: #run)
Instance Method Details
#run_with_logging ⇒ Object 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 |