Commit fae4e077 authored by Michael de Hoog's avatar Michael de Hoog

Fix batcher panic

parent 9bfaf926
...@@ -290,8 +290,10 @@ func (bs *BatcherService) Stop(ctx context.Context) error { ...@@ -290,8 +290,10 @@ func (bs *BatcherService) Stop(ctx context.Context) error {
bs.Log.Info("Stopping batcher") bs.Log.Info("Stopping batcher")
var result error var result error
if err := bs.driver.StopBatchSubmittingIfRunning(ctx); err != nil { if bs.driver != nil {
result = errors.Join(result, fmt.Errorf("failed to stop batch submitting: %w", err)) if err := bs.driver.StopBatchSubmittingIfRunning(ctx); err != nil {
result = errors.Join(result, fmt.Errorf("failed to stop batch submitting: %w", err))
}
} }
if bs.rpcServer != nil { if bs.rpcServer != nil {
...@@ -328,7 +330,7 @@ func (bs *BatcherService) Stop(ctx context.Context) error { ...@@ -328,7 +330,7 @@ func (bs *BatcherService) Stop(ctx context.Context) error {
if result == nil { if result == nil {
bs.stopped.Store(true) bs.stopped.Store(true)
bs.driver.Log.Info("Batch Submitter stopped") bs.Log.Info("Batch Submitter stopped")
} }
return result return result
} }
......
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