class Apollo::Fetcher::SmartFetcher
Public Class Methods
fetch(url, options = {})
click to toggle source
# File lib/apollo_crawler/fetcher/smart_fetcher.rb, line 32 def self.fetch(url, options = {}) # TODO: Throw exception ??? if(@@LAST_FETCH != nil) now = DateTime.now last = @@LAST_FETCH diff = @@DEFAULT_SLEEP - (last - now) sleep(diff) end res = BaseFetcher::fetch(url) @@LAST_FETCH = DateTime.now return res end