From c2f3154fa21327afbf00200fd338133749c86dc7 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Sun, 21 Nov 2021 11:32:00 +1300 Subject: [PATCH] Constructor, not method call --- mopidy_iris/core.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mopidy_iris/core.py b/mopidy_iris/core.py index 0a99e865..c84462c3 100755 --- a/mopidy_iris/core.py +++ b/mopidy_iris/core.py @@ -1195,13 +1195,8 @@ class IrisCore(pykka.ThreadingActor): } try: - http_client = AsyncHTTPClient() - response = await http_client.fetch( - url, - method="POST", - body=json.dumps(data) - validate_cert=self.config["iris"]["verify_certificates"] - ) + http_client = AsyncHTTPClient(validate_cert=self.config["iris"]["verify_certificates"]) + response = await http_client.fetch(url, method="POST", body=json.dumps(data)) except (urllib.error.HTTPError, urllib.error.URLError) as e: error = json.loads(e.read()) logger.error("Could not update Snapcast meta")