mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
refactoring
This commit is contained in:
@@ -417,11 +417,8 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
|
||||
await asyncio.sleep(5)
|
||||
|
||||
with Inotify() as inotify:
|
||||
for path in [
|
||||
*self.__storage.get_watchable_paths(),
|
||||
*self.__drive.get_watchable_paths(),
|
||||
]:
|
||||
await inotify.watch(path, InotifyMask.ALL_MODIFY_EVENTS)
|
||||
await inotify.watch(InotifyMask.ALL_MODIFY_EVENTS, *self.__storage.get_watchable_paths())
|
||||
await inotify.watch(InotifyMask.ALL_MODIFY_EVENTS, *self.__drive.get_watchable_paths())
|
||||
|
||||
# После установки вотчеров еще раз проверяем стейт, чтобы ничего не потерять
|
||||
await self.__reload_state()
|
||||
|
||||
@@ -82,8 +82,8 @@ class Plugin(BaseUserGpioDriver):
|
||||
await asyncio.sleep(5)
|
||||
|
||||
with Inotify() as inotify:
|
||||
await inotify.watch(os.path.dirname(self.__udc_path), InotifyMask.ALL_MODIFY_EVENTS)
|
||||
await inotify.watch(self.__profile_path, InotifyMask.ALL_MODIFY_EVENTS)
|
||||
await inotify.watch(InotifyMask.ALL_MODIFY_EVENTS, os.path.dirname(self.__udc_path))
|
||||
await inotify.watch(InotifyMask.ALL_MODIFY_EVENTS, self.__profile_path)
|
||||
self._notifier.notify()
|
||||
while True:
|
||||
need_restart = False
|
||||
|
||||
Reference in New Issue
Block a user