mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-14 11:51:19 +00:00
fix: handle RuntimeError on trades download
asyncio raises RuntimeError if the handler is not set on the main thread. closes #12211
This commit is contained in:
@@ -3259,7 +3259,7 @@ class Exchange:
|
|||||||
for sig in [signal.SIGINT, signal.SIGTERM]:
|
for sig in [signal.SIGINT, signal.SIGTERM]:
|
||||||
try:
|
try:
|
||||||
self.loop.add_signal_handler(sig, task.cancel)
|
self.loop.add_signal_handler(sig, task.cancel)
|
||||||
except NotImplementedError:
|
except (NotImplementedError, RuntimeError):
|
||||||
# Not all platforms implement signals (e.g. windows)
|
# Not all platforms implement signals (e.g. windows)
|
||||||
pass
|
pass
|
||||||
return self.loop.run_until_complete(task)
|
return self.loop.run_until_complete(task)
|
||||||
|
|||||||
Reference in New Issue
Block a user