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