mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-13 22:03:04 +00:00
Attempt to work-around watchdog bug
This commit is contained in:
parent
e0b7919ad8
commit
35fc563a6f
16
src/allmydata/watchdog/_watchdog_541.py
Normal file
16
src/allmydata/watchdog/_watchdog_541.py
Normal file
@ -0,0 +1,16 @@
|
||||
"""
|
||||
Hotfix for https://github.com/gorakhargosh/watchdog/issues/541
|
||||
"""
|
||||
|
||||
from watchdog.observers.fsevents import FSEventsEmitter
|
||||
|
||||
# The class object has already been bundled up in the default arguments to
|
||||
# FSEventsObserver.__init__. So mutate the class object (instead of replacing
|
||||
# it with a safer version).
|
||||
original_on_thread_stop = FSEventsEmitter.on_thread_stop
|
||||
def safe_on_thread_stop(self):
|
||||
if self.is_alive():
|
||||
return original_on_thread_stop(self)
|
||||
|
||||
def patch():
|
||||
FSEventsEmitter.on_thread_stop = safe_on_thread_stop
|
@ -53,6 +53,9 @@ from ..util.eliotutil import (
|
||||
validateInstanceOf,
|
||||
)
|
||||
|
||||
import ._watchdog_541
|
||||
_watchdog_541.patch()
|
||||
|
||||
NOT_STARTED = "NOT_STARTED"
|
||||
STARTED = "STARTED"
|
||||
STOPPING = "STOPPING"
|
||||
|
Loading…
x
Reference in New Issue
Block a user