3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/ni/tools/timers.rb', line 3
def self.fetch_and_run(metadata_repository_klass, exceptions_logger=nil)
current_timers = metadata_repository_klass.fetch_timers
exceptions = []
current_timers.each do |data|
id, klass_name, action, system_uid = data
begin
klass_name.constantize.public_send(action, system_uid: system_uid)
rescue Exception => e
exceptions << e
ensure
metadata_repository_klass.clear_timer!(id)
end
end
if exceptions_logger.present? && exceptions.present?
exceptions.each { |e| exceptions_logger.log(e) }
end
end
|