From b167e47ee58af79c79f5251350c39606f8b5d7a3 Mon Sep 17 00:00:00 2001
From: Fabrice Le Goff <fabrice.le.goff@cern.ch>
Date: Fri, 17 Aug 2018 17:10:57 +0200
Subject: [PATCH] pause before retrying when ddm publication fails

---
 Script/DdmMonitoringThread.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Script/DdmMonitoringThread.py b/Script/DdmMonitoringThread.py
index d220adc..e1a74a6 100644
--- a/Script/DdmMonitoringThread.py
+++ b/Script/DdmMonitoringThread.py
@@ -95,6 +95,12 @@ class DdmMonitoringThread(threading.Thread):
                                 self.logger.critical('request error for more than 300 seconds')
                                 self.requestErrorCriticalLogged = True
 
+                    # An error has occurred and the non-publised entry has been
+                    # re-added to the queue: if we don't break here we will spin
+                    # in this loop with no pause until the issue is fixed. It's
+                    # better to take a little break and retry later.
+                    break
+
             self.event.wait(self.conf.DdmMonitoringTimeout)
 
         self.logger.info('DdmMonitoringThread exited')
-- 
GitLab