Gotify read connection timeout set to 2.5s (#246)

This commit is contained in:
Chris Caron 2020-07-01 13:51:21 -04:00 committed by GitHub
parent 0bbdbbb547
commit 200e0fabaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,6 +80,10 @@ class NotifyGotify(NotifyBase):
# Disable throttle rate
request_rate_per_sec = 0
# If no bytes have been received on the underlining socket for
# connection_timeout seconds, close the connection.
connection_timeout = 2.5
# Define object templates
templates = (
'{schema}://{host}/{token}',
@ -191,6 +195,7 @@ class NotifyGotify(NotifyBase):
data=dumps(payload),
headers=headers,
verify=self.verify_certificate,
timeout=self.connection_timeout,
)
if r.status_code != requests.codes.ok:
# We had a problem