feat: tag cleanup job (#12654)

This commit is contained in:
Jason Rasmussen
2024-09-16 16:49:12 -04:00
committed by GitHub
parent 4a1ff6abce
commit b74b20824a
23 changed files with 476 additions and 10 deletions

View File

@@ -60,6 +60,9 @@ export enum JobName {
STORAGE_TEMPLATE_MIGRATION = 'storage-template-migration',
STORAGE_TEMPLATE_MIGRATION_SINGLE = 'storage-template-migration-single',
// tags
TAG_CLEANUP = 'tag-cleanup',
// migration
QUEUE_MIGRATION = 'queue-migration',
MIGRATE_ASSET = 'migrate-asset',
@@ -262,6 +265,9 @@ export type JobItem =
| { name: JobName.CLEAN_OLD_AUDIT_LOGS; data?: IBaseJob }
| { name: JobName.CLEAN_OLD_SESSION_TOKENS; data?: IBaseJob }
// Tags
| { name: JobName.TAG_CLEANUP; data?: IBaseJob }
// Asset Deletion
| { name: JobName.PERSON_CLEANUP; data?: IBaseJob }
| { name: JobName.ASSET_DELETION; data: IAssetDeleteJob }

View File

@@ -17,4 +17,5 @@ export interface ITagRepository extends IBulkAsset {
upsertAssetTags({ assetId, tagIds }: { assetId: string; tagIds: string[] }): Promise<void>;
upsertAssetIds(items: AssetTagItem[]): Promise<AssetTagItem[]>;
deleteEmptyTags(): Promise<void>;
}