Fix worker cancellation

This commit is contained in:
Zoltán Papp
2025-08-05 11:09:11 +02:00
parent 8d9411e11e
commit 90ec065c65

View File

@@ -434,10 +434,10 @@ func (c *GrpcClient) startEncryptionWorker(ctx context.Context, handler func(msg
c.decryptionWorker = NewWorker(c.decryptMessage, handler)
c.decryptionWg.Add(1)
workerCtx, workerCancel := context.WithCancel(ctx)
c.decryptionWorkerCancel = workerCancel
go func() {
workerCtx, workerCancel := context.WithCancel(ctx)
defer workerCancel()
c.decryptionWorker.Work(workerCtx)
c.decryptionWg.Done()
}()