mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-01-20 14:00:38 +00:00
chore: Add proper typing to jobContainer response
This commit is contained in:
@@ -12,6 +12,7 @@ from pydantic import (
|
||||
from freqtrade.constants import DL_DATA_TIMEFRAMES, IntOrInf
|
||||
from freqtrade.enums import MarginMode, OrderTypeValues, SignalDirection, TradingMode
|
||||
from freqtrade.ft_types import ValidExchangesType
|
||||
from freqtrade.rpc.api_server.webserver_bgwork import ProgressTask
|
||||
|
||||
|
||||
class ExchangeModePayloadMixin(BaseModel):
|
||||
@@ -50,7 +51,7 @@ class BackgroundTaskStatus(BaseModel):
|
||||
status: str
|
||||
running: bool
|
||||
progress: float | None = None
|
||||
progress_tasks: dict[str, Any] | None = None
|
||||
progress_tasks: dict[str, ProgressTask] | None = None
|
||||
error: str | None = None
|
||||
|
||||
|
||||
|
||||
@@ -4,12 +4,18 @@ from uuid import uuid4
|
||||
from freqtrade.exchange.exchange import Exchange
|
||||
|
||||
|
||||
class ProgressTask(TypedDict):
|
||||
progress: float
|
||||
total: float
|
||||
description: str
|
||||
|
||||
|
||||
class JobsContainer(TypedDict):
|
||||
category: Literal["pairlist", "download_data"]
|
||||
is_running: bool
|
||||
status: str
|
||||
progress: float | None
|
||||
progress_tasks: NotRequired[dict[str, Any]]
|
||||
progress_tasks: NotRequired[dict[str, ProgressTask]]
|
||||
result: Any
|
||||
error: str | None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user