Skip to content

Commit 996b40e

Browse files
committed
check for event type delete
Signed-off-by: Jack <[email protected]>
1 parent 2d86a13 commit 996b40e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/frequenz/sdk/actor/_config_managing.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import os
88
import tomllib
99
from collections import abc
10-
from typing import Any, Dict, Optional, Set
10+
from typing import Any, Dict
1111

1212
from frequenz.channels import Sender
1313
from frequenz.channels.util import FileWatcher
@@ -81,11 +81,12 @@ async def run(self) -> None:
8181
await self.send_config()
8282

8383
async for event in self._file_watcher:
84-
if str(event.path) == self._conf_file:
85-
_logger.info(
86-
"Update configs, because file %s was modified.",
87-
self._conf_file,
88-
)
89-
await self.send_config()
84+
if event.type != FileWatcher.EventType.DELETE:
85+
if str(event.path) == self._conf_file:
86+
_logger.info(
87+
"Update configs, because file %s was modified.",
88+
self._conf_file,
89+
)
90+
await self.send_config()
9091

9192
_logger.debug("ConfigManager stopped.")

0 commit comments

Comments
 (0)