mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Improve "stopped" messages
This commit is contained in:
parent
85725b5472
commit
fc66a12c14
|
@ -2,6 +2,7 @@
|
|||
import asyncio
|
||||
import logging
|
||||
import time
|
||||
from functools import partial
|
||||
from threading import Thread
|
||||
from typing import Dict, Set
|
||||
|
||||
|
@ -88,9 +89,11 @@ class ExchangeWS:
|
|||
task = asyncio.create_task(
|
||||
self._continuously_async_watch_ohlcv(pair, timeframe, candle_type))
|
||||
self._background_tasks.add(task)
|
||||
task.add_done_callback(self._continuous_stopped)
|
||||
task.add_done_callback(partial(
|
||||
self._continuous_stopped, pair=pair, timeframe=timeframe)
|
||||
)
|
||||
|
||||
def _continuous_stopped(self, task: asyncio.Task):
|
||||
def _continuous_stopped(self, task: asyncio.Task, pair: str, timeframe: str):
|
||||
self._background_tasks.discard(task)
|
||||
result = task.result()
|
||||
logger.info(f"Task finished {result}")
|
||||
|
|
Loading…
Reference in New Issue
Block a user