Skip to content

Commit 2b6e854

Browse files
committed
monitoring publish: protection on multiple publish
1 parent d92045f commit 2b6e854

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ConsumerStats.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ class ConsumerStats : public Consumer
235235
double timeUntilTimeout = monitoringUpdateTimer.getRemainingTime(); // measured in seconds
236236
if (timeUntilTimeout <= 0) {
237237
publishStats();
238-
monitoringUpdateTimer.increment();
238+
monitoringUpdateTimer.increment(true);
239+
// ensure a minimum time between consecutive publish
240+
usleep(100000);
239241
} else {
240242
if (timeUntilTimeout > 1) {
241243
timeUntilTimeout = 1.0; // avoid a sleep longer than 1s to allow exiting promptly

0 commit comments

Comments
 (0)