mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-08-23 00:38:07 +00:00
v4.0.11
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "aiomql"
|
name = "aiomql"
|
||||||
version = "4.0.10"
|
version = "4.0.11"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
|
|||||||
@@ -71,8 +71,11 @@ class Executor:
|
|||||||
|
|
||||||
async def run_coroutine_tasks(self):
|
async def run_coroutine_tasks(self):
|
||||||
"""Run all coroutines in the executor"""
|
"""Run all coroutines in the executor"""
|
||||||
await asyncio.gather(*[coroutine(**kwargs) for coroutine, kwargs in self.coroutines.items()],
|
try:
|
||||||
return_exceptions=True)
|
await asyncio.gather(*[coroutine(**kwargs) for coroutine, kwargs in self.coroutines.items()],
|
||||||
|
return_exceptions=True)
|
||||||
|
except Exception as err:
|
||||||
|
logger.error("%s: Error occurred in run_coroutine_tasks", err)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def run_coroutine_task(coroutine, kwargs):
|
def run_coroutine_task(coroutine, kwargs):
|
||||||
@@ -98,18 +101,14 @@ class Executor:
|
|||||||
if self.timeout is not None and self.timeout < (asyncio.get_event_loop().time() - start):
|
if self.timeout is not None and self.timeout < (asyncio.get_event_loop().time() - start):
|
||||||
self.config.shutdown = True
|
self.config.shutdown = True
|
||||||
break
|
break
|
||||||
|
timeout = self.timeout or 1
|
||||||
timeout = 1 if self.timeout else 30
|
|
||||||
await asyncio.sleep(timeout)
|
await asyncio.sleep(timeout)
|
||||||
|
|
||||||
for strategy in self.strategy_runners:
|
for strategy in self.strategy_runners:
|
||||||
strategy.running = False
|
strategy.running = False
|
||||||
|
|
||||||
self.config.task_queue.cancel()
|
self.config.task_queue.cancel()
|
||||||
|
|
||||||
if self.config.backtest_engine is not None:
|
if self.config.backtest_engine is not None:
|
||||||
self.config.backtest_engine.stop_testing = True
|
self.config.backtest_engine.stop_testing = True
|
||||||
|
|
||||||
self.executor.shutdown(wait=False, cancel_futures=False)
|
self.executor.shutdown(wait=False, cancel_futures=False)
|
||||||
|
|
||||||
if self.config.force_shutdown:
|
if self.config.force_shutdown:
|
||||||
|
|||||||
Reference in New Issue
Block a user