Elffuss BraidHub

kikocis/freqtrade public

Don't use response-model on trades endpoint for now
Changeset684fc50fd260a1319d95411a613d4934821bd1f431f422ee28846a4de3951956
AuthorMatthias <xmatthias@outlook.com> · 2021-04-13 06:23 +02:00
CommitterMatthias <xmatthias@outlook.com> · 2021-04-13 06:23 +02:00
Parents2e5ddfd5c849

Browse the files at this changeset

1 file changed

modified freqtrade/rpc/api_server/api_v1.py +4 −3
@@ -17,8 +17,7 @@
1717 OpenTradeSchema, PairHistory, PerformanceEntry,
1818 Ping, PlotConfig, Profit, ResultMsg, ShowConfig,
1919 Stats, StatusMsg, StrategyListResponse,
20- StrategyResponse, TradeResponse, Version,
21- WhitelistResponse)
20+ StrategyResponse, Version, WhitelistResponse)
2221 from freqtrade.rpc.api_server.deps import get_config, get_rpc, get_rpc_optional
2322 from freqtrade.rpc.rpc import RPCException
2423
@@ -83,7 +82,9 @@
8382 return []
8483
8584
86-@router.get('/trades', response_model=TradeResponse, tags=['info', 'trading'])
85+# Using the responsemodel here will cause a ~100% increase in response time (from 1s to 2s)
86+# on big databases. Correct response model: response_model=TradeResponse,
87+@router.get('/trades', tags=['info', 'trading'])
8788 def trades(limit: int = 0, rpc: RPC = Depends(get_rpc)):
8889 return rpc._rpc_trade_history(limit)
8990