Top Level Namespace
Defined Under Namespace
Modules: ApplicationHelper, Capybara, Tanakai Classes: ApplicationSpider, Array, Hash, Numeric, Saver, String, Validator
Instance Method Summary collapse
-
#local_to_utc(time_string, zone:) ⇒ Object
Use local_to_utc helper to setup execution time using your local timezone instead of server’s timezone (which is probably and should be UTC, to check run ‘$ timedatectl`).
Instance Method Details
#local_to_utc(time_string, zone:) ⇒ Object
Use local_to_utc helper to setup execution time using your local timezone instead of server’s timezone (which is probably and should be UTC, to check run ‘$ timedatectl`). Also maybe you’ll want to set same timezone in tanakai as well (use ‘Tanakai.configuration.time_zone =` for that), to have spiders logs in a specific time zone format. Example usage of helper: every 1.day, at: local_to_utc(“7:00”, zone: “Europe/Moscow”) do
crawl "google_spider.com", output: "log/google_spider.com.log"
end
18 19 20 |
# File 'lib/tanakai/template/config/schedule.rb', line 18 def local_to_utc(time_string, zone:) TZInfo::Timezone.get(zone).local_to_utc(Time.parse(time_string)) end |