Commit 166bb009 authored by Michael de Hoog's avatar Michael de Hoog

Lint

parent 93691cc0
......@@ -52,7 +52,7 @@ func Main(version string, cliCtx *cli.Context) error {
return err
}
}
defer batchSubmitter.Stop()
defer batchSubmitter.StopIfRunning()
ctx, cancel := context.WithCancel(context.Background())
......
......@@ -146,6 +146,10 @@ func (l *BatchSubmitter) Start() error {
return nil
}
func (l *BatchSubmitter) StopIfRunning() {
_ = l.Stop()
}
func (l *BatchSubmitter) Stop() error {
l.mutex.Lock()
defer l.mutex.Unlock()
......@@ -160,7 +164,7 @@ func (l *BatchSubmitter) Stop() error {
l.wg.Wait()
l.log.Info("Batch Submitter stopped")
return nil
}
......
......@@ -340,7 +340,7 @@ func TestMigration(t *testing.T) {
}, lgr.New("module", "batcher"))
require.NoError(t, err)
t.Cleanup(func() {
batcher.Stop()
batcher.StopIfRunning()
})
proposer, err := l2os.NewL2OutputSubmitterFromCLIConfig(l2os.CLIConfig{
......
......@@ -212,7 +212,7 @@ func (sys *System) Close() {
sys.L2OutputSubmitter.Stop()
}
if sys.BatchSubmitter != nil {
sys.BatchSubmitter.Stop()
sys.BatchSubmitter.StopIfRunning()
}
for _, node := range sys.RollupNodes {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment