Cache http client with private SD

master
Juan Ignacio Sánchez Lara 9 years ago
parent d6410d91bd
commit 1217b4e4a4

@ -115,7 +115,7 @@ $$
last_err = None
while retry > 0:
try:
client = GD['groups_api_client'] = httplib.HTTPConnection(params['host'], params['port'], False, params['timeout'])
client = SD['groups_api_client'] = httplib.HTTPConnection(params['host'], params['port'], False, params['timeout'])
client.request(method, url, body, headers)
response = client.getresponse()
assert response.status in [ 200, 409 ]
@ -124,7 +124,7 @@ $$
retry -= 1
last_err = err
plpy.warning('Retrying after: ' + str(err))
client = GD['groups_api_client'] = None
client = SD['groups_api_client'] = None
if last_err is not None:
plpy.error('Fatal Group API error: ' + str(last_err))

Loading…
Cancel
Save