aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcedricnjanga2018-05-09 14:43:59 -0700
committerJohan Van Ryseghem2018-05-28 16:20:55 +0200
commit3f7c4b11e27fba2abba6e5bfa676f41b886896e5 (patch)
tree33cf802458b7de806bd839dddfd6f649d99a174f
parent547f8a408883a36f91b1335b67bb9c22de7fbca8 (diff)
downloadchouette-core-3f7c4b11e27fba2abba6e5bfa676f41b886896e5.tar.bz2
Refs #6952 Add missing begin/rescue
-rw-r--r--lib/cron.rb16
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