Class: Connectors::Crawler::Scheduler
Instance Method Summary
collapse
#initialize, #shutdown
Instance Method Details
#connector_settings ⇒ Object
#when_triggered ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/connectors/crawler/scheduler.rb', line 25
def when_triggered
loop do
connector_settings.each do |cs|
if sync_triggered?(cs)
yield cs, :sync, nil
next
end
schedule_key = custom_schedule_triggered(cs)
yield cs, :sync, schedule_key if schedule_key
end
rescue *Utility::AUTHORIZATION_ERRORS => e
log_authorization_error(e)
rescue StandardError => e
log_standard_error(e)
ensure
if @is_shutting_down
break
end
sleep_for_poll_interval
end
end
|