diff options
author | Magnus Hagander | 2020-03-30 19:51:25 +0000 |
---|---|---|
committer | Magnus Hagander | 2020-03-30 19:51:25 +0000 |
commit | b5ff1b6eabf3d3eda3d7c393304abf10b0fd0f11 (patch) | |
tree | f28b541b009b63abdc7740f62e279d9312bd0b9d /loader/lib/varnish.py | |
parent | afc63a3e9431c305809eea8deaa9dacfcc683cf6 (diff) |
Set a timeout for sendinv Varnish purge requests
Timeout error is better than hanging forever. Set a timeout for 30
seconds which is with a big margin longer than should ever be needed.
Diffstat (limited to 'loader/lib/varnish.py')
-rw-r--r-- | loader/lib/varnish.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/loader/lib/varnish.py b/loader/lib/varnish.py index 8a4812b..1004f4d 100644 --- a/loader/lib/varnish.py +++ b/loader/lib/varnish.py @@ -28,6 +28,6 @@ class VarnishPurger(object): r = requests.post(purgeurl, data=purgedict, headers={ 'Content-type': 'application/x-www-form-urlencoded', 'Host': 'www.postgresql.org', - }) + }, timeout=30) if r.status_code != 200: log.error("Failed to send purge request!") |