diff options
| -rw-r--r-- | lib/cron.rb | 16 | 
1 files changed, 12 insertions, 4 deletions
| diff --git a/lib/cron.rb b/lib/cron.rb index 0b94c2209..7e2ca4cdf 100644 --- a/lib/cron.rb +++ b/lib/cron.rb @@ -2,18 +2,26 @@ module Cron    class << self      def sync_organizations -      Organisation.portail_sync +      begin +        Organisation.portail_sync +      rescue => e +        Rails.logger.error(e.inspect) +      end      end      def sync_users -      User.portail_sync +      begin +        User.portail_sync +      rescue => e +        Rails.logger.error(e.inspect) +      end      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? +        sync.save        rescue => e          Rails.logger.warn(e.message)        end @@ -23,7 +31,7 @@ module Cron        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?  +        sync.save         rescue => e          Rails.logger.warn(e.message)        end | 
