[TASK] Modify ftp notify message, increase wait interval from 5 to 10 seconds.
This commit is contained in:
parent
8f178acd5e
commit
0f8e847b32
@ -67,22 +67,23 @@ 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:
|
||||||
self._bot.msg(self._channel, msg)
|
self._bot.msg(self._channel, msg)
|
||||||
self._messages = []
|
self._messages = []
|
||||||
|
|
||||||
watchMask = ( inotify.IN_MODIFY
|
watchMask = ( inotify.IN_MODIFY
|
||||||
| 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()
|
||||||
|
Loading…
Reference in New Issue
Block a user