mirror of
https://github.com/simon987/od-database.git
synced 2025-04-20 02:46:45 +00:00
Modified timeout values
This commit is contained in:
parent
d138db8f06
commit
35b40f002d
8
task.py
8
task.py
@ -33,7 +33,7 @@ class CrawlServer:
|
||||
try:
|
||||
payload = json.dumps(task.to_json())
|
||||
r = requests.post(self.url + "/task/put", headers=self._generate_headers(), data=payload, verify=False,
|
||||
timeout=5)
|
||||
timeout=20)
|
||||
print(r) # TODO: If the task could not be added, fallback to another server
|
||||
return r.status_code == 200
|
||||
except (ConnectionError, ReadTimeout):
|
||||
@ -42,7 +42,7 @@ class CrawlServer:
|
||||
def pop_completed_tasks(self) -> list:
|
||||
|
||||
try:
|
||||
r = requests.get(self.url + "/task/completed", headers=self._generate_headers(), verify=False, timeout=5)
|
||||
r = requests.get(self.url + "/task/completed", headers=self._generate_headers(), verify=False, timeout=15)
|
||||
if r.status_code != 200:
|
||||
print("Problem while fetching completed tasks for '" + self.name + "': " + str(r.status_code))
|
||||
print(r.text)
|
||||
@ -57,7 +57,7 @@ class CrawlServer:
|
||||
def fetch_queued_tasks(self):
|
||||
|
||||
try:
|
||||
r = requests.get(self.url + "/task/", headers=self._generate_headers(), verify=False, timeout=5)
|
||||
r = requests.get(self.url + "/task/", headers=self._generate_headers(), verify=False, timeout=15)
|
||||
|
||||
if r.status_code != 200:
|
||||
print("Problem while fetching queued tasks for '" + self.name + "' " + str(r.status_code))
|
||||
@ -74,7 +74,7 @@ class CrawlServer:
|
||||
def fetch_current_tasks(self):
|
||||
|
||||
try:
|
||||
r = requests.get(self.url + "/task/current", headers=self._generate_headers(), verify=False, timeout=5)
|
||||
r = requests.get(self.url + "/task/current", headers=self._generate_headers(), verify=False, timeout=10)
|
||||
|
||||
if r.status_code != 200:
|
||||
print("Problem while fetching current tasks for '" + self.name + "' " + str(r.status_code))
|
||||
|
Loading…
x
Reference in New Issue
Block a user