feat: add brand asset cleanup worker and related functionality
- Implemented a new BrandAssetCleanupWorker to handle the cleanup of brand-related assets after a brand is deleted. - Added SQL queries for cleaning up articles, keywords, questions, competitors, and monitoring data associated with a brand. - Introduced a new API endpoint to delete publish records. - Updated the router to include the new delete publish record endpoint. - Added tests for the BrandAssetCleanupWorker to ensure proper functionality. - Created migration scripts to support soft deletion of publish records and to add the brand asset cleanup scheduler job.
This commit is contained in:
@@ -158,6 +158,13 @@ func invalidateBrandCaches(ctx context.Context, c sharedcache.Cache, tenantID, b
|
||||
invalidateWorkspaceCaches(ctx, c, tenantID)
|
||||
}
|
||||
|
||||
func InvalidateBrandDeletionCaches(ctx context.Context, c sharedcache.Cache, tenantID, brandID int64) {
|
||||
invalidateBrandCaches(ctx, c, tenantID, brandID)
|
||||
invalidateArticleCaches(ctx, c, tenantID, nil)
|
||||
invalidatePromptRuleCaches(ctx, c, tenantID, brandID, nil)
|
||||
invalidateScheduleTaskCaches(ctx, c, tenantID, nil)
|
||||
}
|
||||
|
||||
func promptRuleGroupsCacheKey(tenantID, brandID int64) string {
|
||||
return fmt.Sprintf("prompt_rule:groups:%d:%d", tenantID, brandID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user