summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/DBStats.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/DBStats.py b/src/lib/Server/Plugins/DBStats.py
index a9686533e..8f28e8c2d 100644
--- a/src/lib/Server/Plugins/DBStats.py
+++ b/src/lib/Server/Plugins/DBStats.py
@@ -34,8 +34,16 @@ class DBStats(Bcfg2.Server.Plugin.StatisticsPlugin):
# FIXME need to build a metadata interface to expose a list of clients
# FIXME Server processing the request should be mentionned here
start = time.time()
- Bcfg2.Server.Reports.importscript.load_stats(
- self.core.metadata.clientdata, container, 0, True)
+ for i in [1,2,3]:
+ try:
+ Bcfg2.Server.Reports.importscript.load_stats(
+ self.core.metadata.clientdata, container, 0, True)
+ break
+ except:
+ logger.error("DBStats: Failed to write data to database due to lock; retrying")
+ if i == 3:
+ logger.error("DBStats: Retry limit failed; aborting operation")
+ return
logger.info("Imported data in the reason fast path in %s second" % (time.time() - start))
def GetExtra(self, client):