Fix test_config.py

This commit is contained in:
grossmj committed 2025-11-17 11:26:06 +10:00
1 parent 4dc321454e
commit 942f021b58
3 files changed
+17 -5

No files matched your search

+8 -1
View File
@@ -60,7 +60,14 @@ class FileWatcher:
self._hashed[path] = zlib.adler32(open(path, 'rb').read())
except OSError:
self._hashed[path] = None
asyncio.get_event_loop().call_later(self._delay, self._check_config_file_change)
try:
loop = asyncio.get_running_loop()
except RuntimeError:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.call_later(self._delay, self._check_config_file_change)
def __del__(self):
self._closed = True