Add cookie pattern analysis worker for prefix auto-detection
Background worker polls cookie_banners with pattern_analysis_requested_at set, groups EXACT patterns sharing a common prefix, and merges groups of 3+ into a PREFIX pattern. Detection sets the flag when new EXACT patterns are created. The worker relinks cookies, removes orphaned patterns, and updates the draft version via ensureDraftVersionForBanner. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -656,6 +656,16 @@ func (impl *Implm) Run(
|
||||
},
|
||||
)
|
||||
|
||||
cookiePatternAnalysisWorker := cookiebanner.NewPatternAnalysisWorker(cookieBannerService, pgClient, l.Named("cookie-pattern-analysis-worker"))
|
||||
cookiePatternAnalysisWorkerCtx, stopCookiePatternAnalysisWorker := context.WithCancel(context.Background())
|
||||
wg.Go(
|
||||
func() {
|
||||
if err := cookiePatternAnalysisWorker.Run(cookiePatternAnalysisWorkerCtx); err != nil {
|
||||
cancel(fmt.Errorf("cookie pattern analysis worker crashed: %w", err))
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
mailingListWorker := mailman.NewMailingListWorker(mailmanService, pgClient, l.Named("mailing-list-worker"))
|
||||
mailingListWorkerCtx, stopMailingListWorker := context.WithCancel(context.Background())
|
||||
wg.Go(
|
||||
@@ -720,6 +730,7 @@ func (impl *Implm) Run(
|
||||
stopTrustCenterServer()
|
||||
stopWebhookSender()
|
||||
stopESignService()
|
||||
stopCookiePatternAnalysisWorker()
|
||||
stopMailingListWorker()
|
||||
stopEvidenceDescriptionWorker()
|
||||
stopDocumentPDFWorker()
|
||||
|
||||
Reference in New Issue
Block a user