Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@circuit(failure_threshold=5, expected_exception=ConnectionError)
def __place_order_exchange(self, request):
print("[{}] {} placing order to stock exchange".format(
request, self.name))
response = requests.get('https://jsonplaceholder.typicode.com/posts/1')
return json.dumps({'code': response.status_code, 'body': response.text})
@circuit(failure_threshold=5, expected_exception=ConnectionError)
def __place_order_exchange(self, uuid):
self.logger.info("placing order in the exchange", extra={
"uuid": uuid})
response = requests.get('https://jsonplaceholder.typicode.com/posts/1')
return json.dumps({'code': response.status_code, 'body': response.text})
@circuit(failure_threshold=5, expected_exception=ConnectionError)
def __place_order_exchange(self, request):
print("[{}] {} placing order to stock exchange".format(
request, self.name))
response = requests.get('https://jsonplaceholder.typicode.com/posts/1')
return json.dumps({'code': response.status_code, 'body': response.text})