diff options
| author | cedricnjanga | 2018-05-09 14:43:59 -0700 |
|---|---|---|
| committer | cedricnjanga | 2018-05-09 14:43:59 -0700 |
| commit | 11975edc476262e2e593b530d34ba053989dc8c2 (patch) | |
| tree | bb89b3c5c4a7981d794336051034a12e2f349a8d | |
| parent | 225870deb7816fef95ad5c656e6f3b6ef9888e31 (diff) | |
| download | chouette-core-11975edc476262e2e593b530d34ba053989dc8c2.tar.bz2 | |
Refs #6952 Add missing begin/rescue
| -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 |
