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 { ...@@ -52,7 +52,7 @@ func Main(version string, cliCtx *cli.Context) error {
return err return err
} }
} }
defer batchSubmitter.Stop() defer batchSubmitter.StopIfRunning()
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
......
...@@ -146,6 +146,10 @@ func (l *BatchSubmitter) Start() error { ...@@ -146,6 +146,10 @@ func (l *BatchSubmitter) Start() error {
return nil return nil
} }
func (l *BatchSubmitter) StopIfRunning() {
_ = l.Stop()
}
func (l *BatchSubmitter) Stop() error { func (l *BatchSubmitter) Stop() error {
l.mutex.Lock() l.mutex.Lock()
defer l.mutex.Unlock() defer l.mutex.Unlock()
......
...@@ -340,7 +340,7 @@ func TestMigration(t *testing.T) { ...@@ -340,7 +340,7 @@ func TestMigration(t *testing.T) {
}, lgr.New("module", "batcher")) }, lgr.New("module", "batcher"))
require.NoError(t, err) require.NoError(t, err)
t.Cleanup(func() { t.Cleanup(func() {
batcher.Stop() batcher.StopIfRunning()
}) })
proposer, err := l2os.NewL2OutputSubmitterFromCLIConfig(l2os.CLIConfig{ proposer, err := l2os.NewL2OutputSubmitterFromCLIConfig(l2os.CLIConfig{
......
...@@ -212,7 +212,7 @@ func (sys *System) Close() { ...@@ -212,7 +212,7 @@ func (sys *System) Close() {
sys.L2OutputSubmitter.Stop() sys.L2OutputSubmitter.Stop()
} }
if sys.BatchSubmitter != nil { if sys.BatchSubmitter != nil {
sys.BatchSubmitter.Stop() sys.BatchSubmitter.StopIfRunning()
} }
for _, node := range sys.RollupNodes { 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