Don't use response-model on trades endpoint for now
This commit is contained in:
parent
9a58a85347
commit
4b902d6eb8
@ -17,8 +17,7 @@ from freqtrade.rpc.api_server.api_schemas import (AvailablePairs, Balances, Blac
|
|||||||
OpenTradeSchema, PairHistory, PerformanceEntry,
|
OpenTradeSchema, PairHistory, PerformanceEntry,
|
||||||
Ping, PlotConfig, Profit, ResultMsg, ShowConfig,
|
Ping, PlotConfig, Profit, ResultMsg, ShowConfig,
|
||||||
Stats, StatusMsg, StrategyListResponse,
|
Stats, StatusMsg, StrategyListResponse,
|
||||||
StrategyResponse, TradeResponse, Version,
|
StrategyResponse, Version, WhitelistResponse)
|
||||||
WhitelistResponse)
|
|
||||||
from freqtrade.rpc.api_server.deps import get_config, get_rpc, get_rpc_optional
|
from freqtrade.rpc.api_server.deps import get_config, get_rpc, get_rpc_optional
|
||||||
from freqtrade.rpc.rpc import RPCException
|
from freqtrade.rpc.rpc import RPCException
|
||||||
|
|
||||||
@ -83,7 +82,9 @@ def status(rpc: RPC = Depends(get_rpc)):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@router.get('/trades', response_model=TradeResponse, tags=['info', 'trading'])
|
# Using the responsemodel here will cause a ~100% increase in response time (from 1s to 2s)
|
||||||
|
# on big databases. Correct response model: response_model=TradeResponse,
|
||||||
|
@router.get('/trades', tags=['info', 'trading'])
|
||||||
def trades(limit: int = 0, rpc: RPC = Depends(get_rpc)):
|
def trades(limit: int = 0, rpc: RPC = Depends(get_rpc)):
|
||||||
return rpc._rpc_trade_history(limit)
|
return rpc._rpc_trade_history(limit)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user