linters: Add modernise tool check and fix issues (#2012)

* linters: Add modernise tool check and fix issues

* engine: Simplify exch.SetDefaults call and remove localWG

* CI: Revert config versions lint workflow
This commit is contained in:
Adrian Gallagher
2025-08-26 12:45:13 +10:00
committed by GitHub
parent 85403fe801
commit d5b2cf1759
22 changed files with 103 additions and 159 deletions

View File

@@ -72,10 +72,7 @@ func (e *Exchange) GetFuturesTickers(ctx context.Context) ([]*ticker.Price, erro
errC <- err
break
}
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
if tick, err2 := e.GetFuturesTicker(ctx, p.String()); err2 != nil {
errC <- err2
} else {
@@ -92,7 +89,7 @@ func (e *Exchange) GetFuturesTickers(ctx context.Context) ([]*ticker.Price, erro
AssetType: asset.Futures,
}
}
}()
})
}
wg.Wait()

View File

@@ -1248,9 +1248,7 @@ func (o *orderbookManager) setNeedsFetchingBook(pair currency.Pair, assetType as
// SynchroniseWebsocketOrderbook synchronises full orderbook for currency pair
// asset
func (e *Exchange) SynchroniseWebsocketOrderbook(ctx context.Context) {
e.Websocket.Wg.Add(1)
go func() {
defer e.Websocket.Wg.Done()
e.Websocket.Wg.Go(func() {
for {
select {
case <-e.Websocket.ShutdownC:
@@ -1262,15 +1260,12 @@ func (e *Exchange) SynchroniseWebsocketOrderbook(ctx context.Context) {
}
}
case j := <-e.obm.jobs:
err := e.processJob(ctx, j.Pair, j.AssetType)
if err != nil {
log.Errorf(log.WebsocketMgr,
"%s processing websocket orderbook error %v",
e.Name, err)
if err := e.processJob(ctx, j.Pair, j.AssetType); err != nil {
log.Errorf(log.WebsocketMgr, "%s processing websocket orderbook error: %v", e.Name, err)
}
}
}
}()
})
}
// SeedLocalCache seeds depth data