From 411db5c9fec9bde2f9c15281dd7b7bc65d5914d2 Mon Sep 17 00:00:00 2001 From: naisanzaa Date: Mon, 20 Nov 2023 09:40:25 -0800 Subject: [PATCH] facebook: use absolute value to avoid negative integer exceptions --- automon/integrations/facebook/groups.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/automon/integrations/facebook/groups.py b/automon/integrations/facebook/groups.py index 3555c6b8..ad4dcbcb 100644 --- a/automon/integrations/facebook/groups.py +++ b/automon/integrations/facebook/groups.py @@ -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, @@ -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,