Skip to content

Commit

Permalink
facebook: use absolute value to avoid negative integer exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Nov 20, 2023
1 parent 7dd7c64 commit 411db5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions automon/integrations/facebook/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,9 @@ def get_with_rate_limiter(
self.screenshot_error()
return result

def rate_limit_decrease(self, multiplier: int = 0.5):
def rate_limit_decrease(self, multiplier: int = 0.25):
before = self._wait_between_retries
self._wait_between_retries = int(self._wait_between_retries * multiplier)
self._wait_between_retries = abs(int(self._wait_between_retries * multiplier))

log.info(str(dict(
before=before,
Expand All @@ -504,9 +504,9 @@ def rate_limit_decrease(self, multiplier: int = 0.5):
)))
return self._wait_between_retries

def rate_limit_increase(self, multiplier: int = 1.5):
def rate_limit_increase(self, multiplier: int = 2):
before = self._wait_between_retries
self._wait_between_retries = int(self._wait_between_retries * multiplier)
self._wait_between_retries = abs(int(self._wait_between_retries * multiplier))

log.info(str(dict(
before=before,
Expand Down

0 comments on commit 411db5c

Please sign in to comment.