mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-23 15:25:14 +00:00
liqmaker: fix interval checking
This commit is contained in:
parent
8073f4c304
commit
55e9910441
|
@ -155,6 +155,8 @@ func (s *Strategy) updateMarketMetrics(ctx context.Context) error {
|
|||
}
|
||||
|
||||
func (s *Strategy) liquidityWorker(ctx context.Context, interval types.Interval) {
|
||||
s.logger.Infof("starting liquidity worker with interval %v", interval)
|
||||
|
||||
metricsTicker := time.NewTicker(5 * time.Second)
|
||||
defer metricsTicker.Stop()
|
||||
|
||||
|
@ -233,8 +235,7 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
|
|||
}
|
||||
})
|
||||
|
||||
if intervalProvider, ok := session.Exchange.(types.CustomIntervalProvider); ok {
|
||||
if intervalProvider.IsSupportedInterval(s.LiquidityUpdateInterval) {
|
||||
if intervalProvider, ok := session.Exchange.(types.CustomIntervalProvider); ok && intervalProvider.IsSupportedInterval(s.LiquidityUpdateInterval) {
|
||||
session.UserDataStream.OnAuth(func() {
|
||||
s.placeLiquidityOrders(ctx)
|
||||
})
|
||||
|
@ -248,7 +249,6 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
|
|||
go s.liquidityWorker(ctx, s.LiquidityUpdateInterval)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
bbgo.OnShutdown(ctx, func(ctx context.Context, wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
|
|
Loading…
Reference in New Issue
Block a user