Scope reset-trackers by keyword and report progress
The reset-trackers operator command reset every uncategorised, non-excluded pattern of a banner and printed only a single summary line once the transaction committed, giving no feedback during long rebuilds. Add a --keyword flag that scopes both the glob decomposition and the mapping reset to patterns whose pattern or display name contains the substring. The match lives in a new TrackerPatternFilter.WithPatternKeyword field so it runs in SQL and is shared by the glob load and the ResetAndRequestMappingByCookieCategoryID update, keeping the two in lockstep. The banner-wide pattern-analysis re-arm is left unscoped. Thread an optional progress callback through ResetBannerTrackers so the command streams per-phase updates (category load, per-glob decomposition, mapping reset, analysis re-arm) as the work runs. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -85,7 +85,7 @@ func TestResetBannerTrackers_FullRebuild(t *testing.T) {
|
||||
return nil
|
||||
}))
|
||||
|
||||
result, err := ResetBannerTrackers(ctx, client, fx.scope, fx.banner.ID, false)
|
||||
result, err := ResetBannerTrackers(ctx, client, fx.scope, fx.banner.ID, false, nil, nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, 1, result.GlobsDecomposed)
|
||||
|
||||
Reference in New Issue
Block a user