@cryptotaxi247 / infra-1 / commits / 6e40e7bf

add timeout to channel exporter requests

According to the requests documentation there's no default timeout whatsoever, which means the update loop can get stuck. If no timeout is specified explicitly, requests do not time out.

Daiderd Jordan committed Jun 11, 2020 at 20:54 UTC 6e40e7bfff181f761dd3cc17f881ec31910f247a
1 file changed +1 -1
delft/eris/channel-exporter.py
+1 -1
@@ -38,7 +38,7 @@ CHANNEL_REQUEST_FAILURES = Counter(
38 def measure_channel(name):
39 try:
40 with CHANNEL_REQUEST_FAILURES.count_exceptions():
41 - result = requests.get(f"https://nixos.org/channels/{name}/git-revision")
41 + result = requests.get(f"https://nixos.org/channels/{name}/git-revision", timeout=10)
42
43 try:
44 return {