In sync_execute, commands are executed by making requests to the Upstash REST API like this...
response = session.post(url, headers=headers, json=command).json()
...where session is a requests.Session instance.
As indicated by the requests documentation, this call should include a timeout to avoid blocking for long periods in the event of networking trouble:
Nearly all production code should use this parameter [timeout] in nearly all requests. Failure to do so can cause your program to hang indefinitely
For the Redis workloads I typically have, no response from Redis is better than a slow response from Redis. The client should at least allow users to configure a timeout for these requests, and in my opinion should also have a default timeout enabled without user intervention.
In
sync_execute, commands are executed by making requests to the Upstash REST API like this......where
sessionis arequests.Sessioninstance.As indicated by the
requestsdocumentation, this call should include atimeoutto avoid blocking for long periods in the event of networking trouble:For the Redis workloads I typically have, no response from Redis is better than a slow response from Redis. The client should at least allow users to configure a timeout for these requests, and in my opinion should also have a default timeout enabled without user intervention.