From 0f8e847b32c1f1a1d47567029208cffbde0baf90 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sat, 12 Jul 2014 13:27:00 +0200 Subject: [PATCH] [TASK] Modify ftp notify message, increase wait interval from 5 to 10 seconds. --- twisted/plugins/monitorbot_plugin.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/twisted/plugins/monitorbot_plugin.py b/twisted/plugins/monitorbot_plugin.py index 5f37b97..b45a37f 100644 --- a/twisted/plugins/monitorbot_plugin.py +++ b/twisted/plugins/monitorbot_plugin.py @@ -67,22 +67,23 @@ class MonitorBotService(Service): msg = "ftp> /%s (%s)" % (new_path, ', '.join(humanReadableMask(mask))) if msg not in self._messages: self._messages.append(msg) - self._callid = reactor.callLater(5.0, sendQueuedMessages) + self._callid = reactor.callLater(10.0, sendQueuedMessages) def sendQueuedMessages(): if len(self._messages) > 3: - self._bot.msg(self._channel, "ftp> %i Aktionen durchgeführt. Letzte Nachricht:" % len(self._messages)) + self._bot.msg(self._channel, "ftp> %i Events übersprungen. Letzter Event:" % len(self._messages)-1) self._bot.msg(self._channel, self._messages[len(self._messages)-1]) else: for msg in self._messages: self._bot.msg(self._channel, msg) self._messages = [] - watchMask = ( inotify.IN_MODIFY - | inotify.IN_CREATE - | inotify.IN_DELETE - | inotify.IN_MOVED_FROM - | inotify.IN_MOVED_TO ) + watchMask = ( inotify.IN_MODIFY + | inotify.IN_CREATE + | inotify.IN_DELETE + | inotify.IN_MOVED_FROM + | inotify.IN_MOVED_TO + ) notifier = inotify.INotify() notifier.startReading()