Skip to content

Commit

Permalink
feat: Add 6th retry attempt to symlinker (#926)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
wolfemir authored Dec 6, 2024
1 parent eacfe06 commit 6d43d7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/program/symlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 6d43d7f

Please sign in to comment.