blob: 0b94c2209435c6f86d4035cb9d39ed16118dabc3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
module Cron
class << self
def sync_organizations
Organisation.portail_sync
end
def sync_users
User.portail_sync
end
def sync_reflex
begin
sync = StopAreaReferential.find_by(name: 'Reflex').stop_area_referential_syncs.build
raise "reflex:sync aborted - There is already an synchronisation in progress" unless sync.valid?
sync.save if sync.valid?
rescue => e
Rails.logger.warn(e.message)
end
end
def sync_codifligne
begin
sync = LineReferential.find_by(name: 'CodifLigne').line_referential_syncs.build
raise "Codifligne:sync aborted - There is already an synchronisation in progress" unless sync.valid?
sync.save if sync.valid?
rescue => e
Rails.logger.warn(e.message)
end
end
def check_import_operations
begin
ParentNotifier.new(ComplianceCheckSet).notify_when_finished
ComplianceCheckSet.abort_old
rescue => e
Rails.logger.error(e.inspect)
end
end
def check_ccset_operations
begin
ParentNotifier.new(Import::Base).notify_when_finished
Import::Netex.abort_old
rescue => e
Rails.logger.error(e.inspect)
end
end
end
end
|