[wgem] adding category

This commit is contained in:
Vinícius Moreira
2019-12-13 16:35:00 -03:00
parent 7a3df32471
commit 174349cf5b
17 changed files with 156 additions and 59 deletions

View File

@@ -16,7 +16,7 @@ class HttpClient:
self.sleep = sleep
self.logger = logger
def get(self, url: str, params: dict = None, headers: dict = None, allow_redirects: bool = True, ignore_ssl: bool = False):
def get(self, url: str, params: dict = None, headers: dict = None, allow_redirects: bool = True, ignore_ssl: bool = False, single_call: bool = False):
cur_attempts = 1
while cur_attempts <= self.max_attempts:
@@ -39,6 +39,9 @@ class HttpClient:
if res.status_code == 200:
return res
if single_call:
return
if self.sleep > 0:
time.sleep(self.sleep)
except Exception as e: