Skip to content

Commit

Permalink
Change suggested by @osanders to avoid loading contact file x2
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Nov 17, 2021
1 parent 02648bf commit 95f183f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/cylc/network/httpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def put_messages(self, payload):
event_time (str): Event time as string.
messages (list): List in the form [[severity, message], ...].
"""
self._load_contact_info()
func_name = self._compat('put_messages')
retry_intvl = float(self.comms1.get(
self.srv_files_mgr.KEY_TASK_MSG_RETRY_INTVL,
self.MSG_RETRY_INTVL))
Expand All @@ -271,7 +271,8 @@ def put_messages(self, payload):
if self.timeout is None:
self.timeout = self.MSG_TIMEOUT
try:
func_name = self._compat('put_messages')
if not func_name:
func_name = self._compat('put_messages')
if func_name == 'put_messages':
results = self._call_server(func_name, payload=payload)
elif func_name == 'put_message': # API 1, 7.5.0 compat
Expand Down Expand Up @@ -315,6 +316,8 @@ def put_messages(self, payload):
return results
finally:
self.timeout = orig_timeout
self.comms1 = {}
func_name = None

def reset(self):
"""Compat method, does nothing."""
Expand Down

0 comments on commit 95f183f

Please sign in to comment.