[icinga-checkins] icinga.org: icingaweb2-module-director/feature-ddo-playground: EventstreamCommand: commit states immediately

git at icinga.org git at icinga.org
Tue Jul 19 10:31:52 CEST 2016


Module: icingaweb2-module-director
Branch: feature-ddo-playground
Commit: cc27e7a0c5caaa582943e7c95828c92bbd77c086
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=cc27e7a0c5caaa582943e7c95828c92bbd77c086

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue Jun 21 15:52:50 2016 +0200

EventstreamCommand: commit states immediately

---

 application/clicommands/EventstreamCommand.php |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/application/clicommands/EventstreamCommand.php b/application/clicommands/EventstreamCommand.php
index 17e9792..4a0cefa 100644
--- a/application/clicommands/EventstreamCommand.php
+++ b/application/clicommands/EventstreamCommand.php
@@ -73,6 +73,14 @@ class EventstreamCommand extends DdoCommand
             }
 
             echo "Got nothing for 1secs\n";
+
+            if ($cnt > 0) {
+                $time = time();
+                echo "Committing $cnt events\n";
+                $cnt = 0;
+                $db->commit();
+                $hasTransaction = false;
+            }
         }
     }
 



More information about the icinga-checkins mailing list