Migrate workers to kit/worker
Replace hand-rolled polling loops, semaphores, and WaitGroups in all 7 background workers with go.gearno.de/kit/worker. Each worker now implements Handler[T] (Claim/Process) and optionally StaleRecoverer, gaining automatic Prometheus metrics and OpenTelemetry tracing. Bumps kit from v0.3.0 to v0.5.0. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -111,18 +111,17 @@ func NewService(
|
||||
func (s *Service) Run(ctx context.Context, presenterConfigFunc EmailPresenterConfigFunc) error {
|
||||
g, gctx := errgroup.WithContext(ctx)
|
||||
|
||||
nonCancelableCtx := context.WithoutCancel(ctx)
|
||||
|
||||
sealingWorkerCtx, stopSealingWorker := context.WithCancel(nonCancelableCtx)
|
||||
sealingWorkerCtx, stopSealingWorker := context.WithCancel(ctx)
|
||||
sealingWorker := NewSealingWorker(
|
||||
s.pg,
|
||||
s.fileManager,
|
||||
s.tsaClient,
|
||||
s.logger.Named("sealing-worker"),
|
||||
nil,
|
||||
)
|
||||
g.Go(func() error { return sealingWorker.Run(sealingWorkerCtx) })
|
||||
|
||||
certWorkerCtx, stopCertWorker := context.WithCancel(nonCancelableCtx)
|
||||
certWorkerCtx, stopCertWorker := context.WithCancel(ctx)
|
||||
certWorker := NewCompletionCertificateWorker(
|
||||
s.pg,
|
||||
s.fileManager,
|
||||
|
||||
Reference in New Issue
Block a user