Create the watchdog Observer sooner

This lets us watch before start which Windows seems to really want.
This commit is contained in:
Jean-Paul Calderone 2019-03-11 13:22:35 -04:00
parent 263755fb26
commit 3176b6f18a

View File

@ -165,6 +165,7 @@ class INotify(PollMixin):
self._callbacks = {}
self._watches = {}
self._state = NOT_STARTED
self._observer = Observer(timeout=self._pending_delay)
def set_pending_delay(self, delay):
Message.log(message_type=u"watchdog:inotify:set-pending-delay", delay=delay)
@ -178,7 +179,6 @@ class INotify(PollMixin):
# XXX twisted.internet.inotify doesn't require watches to
# be set before startReading is called.
# _assert(len(self._callbacks) != 0, "no watch set")
self._observer = Observer(timeout=self._pending_delay)
self._observer.start()
self._state = STARTED
except: