refactoring

This commit is contained in:
Maxim Devaev
2023-03-17 23:41:59 +02:00
parent 166cb8e3b7
commit dbb9eda341
3 changed files with 13 additions and 15 deletions

View File

@@ -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()