diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-05-31 20:17:01 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-05-31 20:17:01 +0200 |
commit | 43e211e2765ea3e929d6e146a11cdd8d5f87df30 (patch) | |
tree | daa589d1bda79afe73a780f6d437d7ccd602a01c /reach_reports/reach_application.rb | |
parent | 9bec29d07a797090982e831a774c3aae532a9e9e (diff) |
retry hack for mysql lite
Diffstat (limited to 'reach_reports/reach_application.rb')
-rwxr-xr-x | reach_reports/reach_application.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/reach_reports/reach_application.rb b/reach_reports/reach_application.rb index c3d6fbd..d914452 100755 --- a/reach_reports/reach_application.rb +++ b/reach_reports/reach_application.rb @@ -5,6 +5,20 @@ end QMRF_EDITOR_URI = "http://ortona.informatik.uni-freiburg.de/qmrfedit/OT_QMRFEditor.jnlp" +# hack for as long as mysql lite is used +def mysql_lite_retry( n_times=15 ) + n_times.times do + begin + yield + return + rescue => ex + LOGGER.warn "datamapper error, wait and retry : "+ex.message + sleep(1+rand(3)) # wait 1-3 seconds + end + end + yield # try a last time +end + require 'reach_reports/reach_persistance.rb' require 'reach_reports/reach_service.rb' |