Add worker that regenerates the tracker policy

Add a poll-based tracker policy worker that claims banners flagged for
policy generation, clears the flag, and rebuilds the cookie and
tracking technologies policy from the latest published snapshot. A
banner that lost its published version is skipped rather than failed.

Wire the worker into probod with crash propagation and graceful
shutdown alongside the other tracker workers.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-06-01 18:25:21 +02:00
parent d68df53a6d
commit 4d64b1f937
3 changed files with 128 additions and 14 deletions

View File

@@ -732,6 +732,17 @@ func (impl *Implm) Run(
},
)
trackerPolicyWorker := probo.NewTrackerPolicyWorker(proboService.GeneratedDocuments, pgClient, l)
trackerPolicyWorkerCtx, stopTrackerPolicyWorker := context.WithCancel(context.Background())
wg.Go(
func() {
if err := trackerPolicyWorker.Run(trackerPolicyWorkerCtx); err != nil {
cancel(fmt.Errorf("tracker policy worker crashed: %w", err))
}
},
)
trackerMappingWorker := cookiebanner.NewTrackerMappingWorker(
pgClient,
l,
@@ -870,6 +881,7 @@ func (impl *Implm) Run(
stopWebhookSender()
stopESignService()
stopTrackerPatternAnalysisWorker()
stopTrackerPolicyWorker()
stopTrackerMappingWorker()
stopCommonPatternEnrichmentWorker()
stopMailingListWorker()