diff options
Diffstat (limited to 'lib/tasks')
| -rw-r--r-- | lib/tasks/codifligne.rake | 3 | ||||
| -rw-r--r-- | lib/tasks/reflex.rake | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/tasks/codifligne.rake b/lib/tasks/codifligne.rake index 4a108f789..dd5e99370 100644 --- a/lib/tasks/codifligne.rake +++ b/lib/tasks/codifligne.rake @@ -1,8 +1,7 @@ namespace :codifligne do desc "Sync lines, companies, networks, and group of lines from codifligne" task sync: :environment do - lref = LineReferential.find_by(name: 'CodifLigne') - sync = lref.line_referential_syncs.build + 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? end diff --git a/lib/tasks/reflex.rake b/lib/tasks/reflex.rake index 0020f1b60..67496cee0 100644 --- a/lib/tasks/reflex.rake +++ b/lib/tasks/reflex.rake @@ -1,8 +1,8 @@ namespace :reflex do desc "Sync data from Reflex api" task sync: :environment do - start = Time.now - Stif::ReflexSynchronization.synchronize - Rails.logger.debug "Reflex:sync done in #{Time.now - start} seconds !" + 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? end end |
