Created
May 15, 2018 23:55
-
-
Save dev4Fun/5c47b7dcd64e4418fbde10f9e8e4ce1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def _wait_order_complete(self, order_id): | |
status = 'open' | |
order = None | |
while status is 'open': | |
await asyncio.sleep(self.check_timeout) | |
order = self.exchange.fetch_order(order_id) | |
status = order['status'] | |
logging.info(f'Finished order {order_id} with {status} status') | |
# do not proceed further if we canceled order | |
if status == 'canceled': | |
raise ExchangeError('Trade has been canceled') | |
return order |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment