[TASK] Modify ftp notify message, increase wait interval from 5 to 10 seconds.

This commit is contained in:
Jan Philipp Timme 2014-07-12 13:27:00 +02:00
parent 8f178acd5e
commit 0f8e847b32
1 changed files with 8 additions and 7 deletions

View File

@ -67,11 +67,11 @@ class MonitorBotService(Service):
msg = "ftp> /%s (%s)" % (new_path, ', '.join(humanReadableMask(mask))) msg = "ftp> /%s (%s)" % (new_path, ', '.join(humanReadableMask(mask)))
if msg not in self._messages: if msg not in self._messages:
self._messages.append(msg) self._messages.append(msg)
self._callid = reactor.callLater(5.0, sendQueuedMessages) self._callid = reactor.callLater(10.0, sendQueuedMessages)
def sendQueuedMessages(): def sendQueuedMessages():
if len(self._messages) > 3: 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]) self._bot.msg(self._channel, self._messages[len(self._messages)-1])
else: else:
for msg in self._messages: for msg in self._messages:
@ -82,7 +82,8 @@ class MonitorBotService(Service):
| inotify.IN_CREATE | inotify.IN_CREATE
| inotify.IN_DELETE | inotify.IN_DELETE
| inotify.IN_MOVED_FROM | inotify.IN_MOVED_FROM
| inotify.IN_MOVED_TO ) | inotify.IN_MOVED_TO
)
notifier = inotify.INotify() notifier = inotify.INotify()
notifier.startReading() notifier.startReading()