Skip to content

Commit d49fe2c

Browse files
committed
refactor: FIFO instead of LIFO
1 parent 8e7c4a3 commit d49fe2c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/plex_nfs_watchdog/modules/config/shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
cache_path: Path = Path(f"{str(Path.home())}/{system_paths[sys.platform]}/plex_nfs_watchdog_cache/plex_config.json")
1111

1212
listeners_type: list[str] = ["move", "modify", "create", "delete", "io_close", "io_open"]
13-
VERSION: str = "0.0.6"
13+
VERSION: str = "0.0.7"
1414
user_input: Namespace

src/plex_nfs_watchdog/modules/plex/plex_agent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class PlexAgent:
1414
__server: PlexServer = None
1515
__save_cache: bool = False
1616
__internal_paths: dict[str, tuple[str, str]] = {}
17-
__notify_queue: set[tuple[str, str]] = set()
17+
__notify_queue: list[tuple[str, str]] = list()
1818
__supported_ext: list[str] = [
1919
"3g2",
2020
"3gp",
@@ -189,7 +189,7 @@ def _scan(self, section: str, item: str) -> None:
189189
if plex_section.refreshing:
190190
if shared.user_input.daemon:
191191
logging.warning(f"Plex section {section_title} is already refreshing, re-scheduling...")
192-
self.__notify_queue.add((section, item))
192+
self.__notify_queue.append((section, item))
193193
else:
194194
logging.warning(f"Plex section {section_title} is already refreshing, skipping...")
195195
return
@@ -235,7 +235,7 @@ def parse_event(self, event) -> None:
235235
section_scan = (section_child.parent.name, section_child.name)
236236
if section_scan not in self.__notify_queue:
237237
logging.info(f"Adding to queue ({event_type}): {section_child.name}")
238-
self.__notify_queue.add(section_scan)
238+
self.__notify_queue.append(section_scan)
239239

240240
def start_service(self) -> ():
241241
"""
@@ -247,7 +247,7 @@ def start_service(self) -> ():
247247
def loop():
248248
while not stopped.wait(shared.user_input.interval):
249249
if self.__notify_queue:
250-
section, item = self.__notify_queue.pop()
250+
section, item = self.__notify_queue.pop(0)
251251
self._scan(section, item)
252252

253253
Thread(target=loop).start()

0 commit comments

Comments
 (0)