Convert this message to an action for success/failure reporting

This commit is contained in:
Jean-Paul Calderone 2019-03-14 09:19:50 -04:00
parent 5cf223645d
commit 8fa6c66c2f

View File

@ -5,6 +5,7 @@
import os, sys import os, sys
from eliot import ( from eliot import (
start_action,
Message, Message,
log_call, log_call,
) )
@ -294,14 +295,15 @@ class INotify(PollMixin):
while True: while True:
self._state = STARTED self._state = STARTED
Message.log( action = start_action(
message_type=u"read-changes", action_type=u"read-changes",
directory=self._path.path, directory=self._path.path,
recursive=self._recursive, recursive=self._recursive,
filter=self._filter, filter=self._filter,
) )
try: try:
fni.read_changes(self._hDirectory, self._recursive, self._filter) with action:
fni.read_changes(self._hDirectory, self._recursive, self._filter)
except WindowsError as e: except WindowsError as e:
self._state = STOPPING self._state = STOPPING