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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user