From 6d43d7f34bacb82ad8e2cca08f6ab15c6b3a2e2c Mon Sep 17 00:00:00 2001 From: Arrrrr <11490236+wolfemir@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:15:09 -0800 Subject: [PATCH] feat: Add 6th retry attempt to symlinker (#926) * feat: Add 6th retry attempt with 100s delay to symlinker * feat: Implement capped exponential backoff for symlink retries * feat: Implement capped exponential backoff for symlink retries * feat: Implement capped exponential backoff for symlink retries --- src/program/symlink.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/program/symlink.py b/src/program/symlink.py index bbf73952..423c5cc7 100644 --- a/src/program/symlink.py +++ b/src/program/symlink.py @@ -88,7 +88,7 @@ def run(self, item: Union[Movie, Show, Season, Episode]): """Check if the media item exists and create a symlink if it does""" items = self._get_items_to_update(item) if not self._should_submit(items): - if item.symlinked_times == 5: + if item.symlinked_times == 6: logger.debug(f"Soft resetting {item.log_string} because required files were not found") item.blacklist_active_stream() item.reset() @@ -106,7 +106,7 @@ def run(self, item: Union[Movie, Show, Season, Episode]): yield item def _calculate_next_attempt(self, item: Union[Movie, Show, Season, Episode]) -> datetime: - base_delay = timedelta(seconds=5) + base_delay = timedelta(seconds=4) next_attempt_delay = base_delay * (2 ** item.symlinked_times) next_attempt_time = datetime.now() + next_attempt_delay return next_attempt_time