From aba1cdf6d93452ae01e23a92d5b16c04183e7f99 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Wed, 11 May 2016 11:31:18 -0400 Subject: [PATCH] Update customer.rb --- app/models/customer.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/customer.rb b/app/models/customer.rb index ec254dd..c96da6e 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -138,10 +138,11 @@ class Customer < ActiveRecord::Base # Push the updates def push - begin + begin + tries ||= 3 get_base.update(@details) rescue - return nil + retry unless (tries -= 1).zero? end end @@ -157,9 +158,10 @@ class Customer < ActiveRecord::Base # init details def get_details begin + tries ||= 3 @details = get_customer(self.id) rescue - return nil + retry unless (tries -= 1).zero? end end