AnyLog-co / AnyLog-co/AnyLog-API

timeout fix

Offen
#10 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
0
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

so there's 2/2 parts to the issue:
in the remote-gui, we need to add an option to update the timeout and update the class variables accordingly
timeout needs to be broken into 2 parts connections_timeout and read_tieout

Code to be updated::
[AnyLog-API/anylog_api/anylog_connector.py at main · AnyLog-co/AnyLog-API](https://github.com/AnyLog-co/AnyLog-API/blob/main/anylog_api/anylog_connector.py)
```
try:
response = requests.get(f'http://{self.conn}', headers=headers, auth=self.auth, timeout=self.timeout)
except Exception as e:
error = str(e)
response = False
else:
if int(response.status_code) < 200 or int(response.status_code) > 299:
error = int(response.status_code)
response = False
Expect:
try:
response = requests.get(f'http://{self.conn}', headers=headers, auth=self.auth, timeout=(connection_timeout, read_timeout)
except Exception as e:
error = str(e)
response = False
else:
if int(response.status_code) < 200 or int(response.status_code) > 299:
error = int(response.status_code)
response = False
[anylog_connector.py](https://github.com/AnyLog-co/AnyLog-API/blob/main/anylog_api/anylog_connector.py)

both the connection_timeout and read_timeout should be user configurable via the remote-gui

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.