mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 00:01:09 +00:00
use NamedQueryContext instead of NamedQuery
This commit is contained in:
parent
26d0fedcec
commit
6afde4808f
|
@ -648,7 +648,7 @@ func (environ *Environment) syncSession(
|
|||
log.Infof("syncing symbols %v from session %s", symbols, session.Name)
|
||||
|
||||
syncBufferPeriod := -defaultSyncBufferPeriod
|
||||
if environ.environmentConfig.SyncBufferPeriod != nil {
|
||||
if environ.environmentConfig != nil && environ.environmentConfig.SyncBufferPeriod != nil {
|
||||
syncBufferPeriod = -environ.environmentConfig.SyncBufferPeriod.Duration()
|
||||
}
|
||||
|
||||
|
|
|
@ -335,7 +335,7 @@ func (s *TradeService) Query(options QueryTradesOptions) ([]types.Trade, error)
|
|||
func (s *TradeService) Load(ctx context.Context, id int64) (*types.Trade, error) {
|
||||
var trade types.Trade
|
||||
|
||||
rows, err := s.DB.NamedQuery("SELECT * FROM trades WHERE id = :id", map[string]interface{}{
|
||||
rows, err := s.DB.NamedQueryContext(ctx, "SELECT * FROM trades WHERE id = :id", map[string]interface{}{
|
||||
"id": id,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user