summaryrefslogtreecommitdiff
path: root/reach_reports/reach_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'reach_reports/reach_service.rb')
-rwxr-xr-xreach_reports/reach_service.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/reach_reports/reach_service.rb b/reach_reports/reach_service.rb
index 0cf4172..1ec48e8 100755
--- a/reach_reports/reach_service.rb
+++ b/reach_reports/reach_service.rb
@@ -277,7 +277,9 @@ module ReachReports
end
task.progress(90) if task
- r.save
+ mysql_lite_retry do
+ r.save
+ end
task.progress(100) if task
end
@@ -292,14 +294,16 @@ module ReachReports
# end
def self.get_report(type, id)
-
- case type
- when /(?i)QMRF/
- report = ReachReports::QmrfReport.get(id)
- when /(?i)QPRF/
- report = ReachReports::QprfReport.get(id)
+ report = nil
+ mysql_lite_retry(3) do
+ case type
+ when /(?i)QMRF/
+ report = ReachReports::QmrfReport.get(id)
+ when /(?i)QPRF/
+ report = ReachReports::QprfReport.get(id)
+ end
+ raise OpenTox::NotFoundError.new type+" report with id '#{id}' not found." unless report
end
- raise OpenTox::NotFoundError.new type+" report with id '#{id}' not found." unless report
return report
end