diff options
Diffstat (limited to 'lib/tasks/reflex.rake')
| -rw-r--r-- | lib/tasks/reflex.rake | 6 |
1 files changed, 3 insertions, 3 deletions
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 |
