Open realstudent01 opened 2 months ago
You should not assume that the connection attempt will always work - there can be timeouts, other interrupts, etc. I would wrap your code in a try / except block, and handle any failures accordingly. Probably just by re-attempting.
Adding a small delay between requests will probably help, too.
I am making a front end dashboard to view some information in a database with the InvenTree API. Seemingly randomly I am getting the following errors:
"requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))"
"requests.exceptions.ChunkedEncodingError: ("Connection broken: ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)", ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))"
Is the issue that I need to do something to keep the api instance (that I initialize to make the connection) open? Or do I need to give a certain value as the timeout?