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.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/reach_reports/reach_service.rb b/reach_reports/reach_service.rb
index b6c6350..916a7a4 100755
--- a/reach_reports/reach_service.rb
+++ b/reach_reports/reach_service.rb
@@ -279,8 +279,9 @@ module ReachReports
end
end
task.progress(90) if task
-
- r.save
+ mysql_lite_retry do
+ r.save
+ end
task.progress(100) if task
end
@@ -295,14 +296,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