mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-12 05:55:35 +00:00
Log fs events on Windows
This commit is contained in:
parent
0e3c4d40b8
commit
aed5c4604e
@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
|
from eliot import (
|
||||||
|
log_call,
|
||||||
|
)
|
||||||
|
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
from twisted.internet.threads import deferToThread
|
from twisted.internet.threads import deferToThread
|
||||||
|
|
||||||
@ -22,6 +26,10 @@ from allmydata.util.assertutil import _assert, precondition
|
|||||||
from allmydata.util.encodingutil import quote_output
|
from allmydata.util.encodingutil import quote_output
|
||||||
from allmydata.util import log, fileutil
|
from allmydata.util import log, fileutil
|
||||||
from allmydata.util.pollmixin import PollMixin
|
from allmydata.util.pollmixin import PollMixin
|
||||||
|
from ..util.eliotutil import (
|
||||||
|
MAYBE_NOTIFY,
|
||||||
|
CALLBACK,
|
||||||
|
)
|
||||||
|
|
||||||
from ctypes import WINFUNCTYPE, WinError, windll, POINTER, byref, create_string_buffer, \
|
from ctypes import WINFUNCTYPE, WinError, windll, POINTER, byref, create_string_buffer, \
|
||||||
addressof, get_last_error
|
addressof, get_last_error
|
||||||
@ -279,13 +287,20 @@ class INotify(PollMixin):
|
|||||||
continue
|
continue
|
||||||
#mask = _action_to_inotify_mask.get(info.action, IN_CHANGED)
|
#mask = _action_to_inotify_mask.get(info.action, IN_CHANGED)
|
||||||
|
|
||||||
|
@log_call(
|
||||||
|
action_type=MAYBE_NOTIFY.action_type,
|
||||||
|
include_args=[],
|
||||||
|
include_result=False,
|
||||||
|
)
|
||||||
def _do_pending_calls():
|
def _do_pending_calls():
|
||||||
|
event_mask = IN_CHANGED
|
||||||
self._pending_call = None
|
self._pending_call = None
|
||||||
for path1 in self._pending:
|
for path1 in self._pending:
|
||||||
if self._callbacks:
|
if self._callbacks:
|
||||||
for cb in self._callbacks:
|
for cb in self._callbacks:
|
||||||
try:
|
try:
|
||||||
cb(None, path1, IN_CHANGED)
|
with CALLBACK(inotify_events=event_mask):
|
||||||
|
cb(None, path1, event_mask)
|
||||||
except Exception, e2:
|
except Exception, e2:
|
||||||
log.err(e2)
|
log.err(e2)
|
||||||
self._pending = set()
|
self._pending = set()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user