mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
check if limit is set
This commit is contained in:
parent
02512805f8
commit
bc3754d989
|
@ -270,7 +270,6 @@ func (s *TradeService) Load(ctx context.Context, id int64) (*types.Trade, error)
|
|||
return nil, errors.Wrapf(ErrTradeNotFound, "trade id:%d not found", id)
|
||||
}
|
||||
|
||||
|
||||
func (s *TradeService) MarkStrategyID(ctx context.Context, id int64, strategyID string) error {
|
||||
result, err := s.DB.NamedExecContext(ctx, "UPDATE `trades` SET `strategy` = :strategy WHERE `id` = :id", map[string]interface{}{
|
||||
"id": id,
|
||||
|
@ -348,7 +347,10 @@ func queryTradesSQL(options QueryTradesOptions) string {
|
|||
|
||||
sql += ` ORDER BY gid ` + ordering
|
||||
|
||||
if options.Limit > 0 {
|
||||
sql += ` LIMIT ` + strconv.Itoa(options.Limit)
|
||||
}
|
||||
|
||||
return sql
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user