Changesets · Branches · Tags · Compare
| Changeset | 684fc50fd260a1319d95411a613d4934821bd1f431f422ee28846a4de3951956 |
|---|---|
| Author | Matthias <xmatthias@outlook.com> · 2021-04-13 06:23 +02:00 |
| Committer | Matthias <xmatthias@outlook.com> · 2021-04-13 06:23 +02:00 |
| Parents | 2e5ddfd5c849 |
1 file changed
modified freqtrade/rpc/api_server/api_v1.py +4 −3
| @@ -17,8 +17,7 @@ | ||
| 17 | 17 | OpenTradeSchema, PairHistory, PerformanceEntry, |
| 18 | 18 | Ping, PlotConfig, Profit, ResultMsg, ShowConfig, |
| 19 | 19 | Stats, StatusMsg, StrategyListResponse, |
| 20 | - StrategyResponse, TradeResponse, Version, | |
| 21 | - WhitelistResponse) | |
| 20 | + StrategyResponse, Version, WhitelistResponse) | |
| 22 | 21 | from freqtrade.rpc.api_server.deps import get_config, get_rpc, get_rpc_optional |
| 23 | 22 | from freqtrade.rpc.rpc import RPCException |
| 24 | 23 | |
| @@ -83,7 +82,9 @@ | ||
| 83 | 82 | return [] |
| 84 | 83 | |
| 85 | 84 | |
| 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']) | |
| 87 | 88 | def trades(limit: int = 0, rpc: RPC = Depends(get_rpc)): |
| 88 | 89 | return rpc._rpc_trade_history(limit) |
| 89 | 90 |