Chore: Move annotations cleanup to the annotations service (#55618)

This commit is contained in:
Sofia Papagiannaki
2022-09-22 15:27:48 +03:00
committed by GitHub
parent 4739ff06a5
commit 2f14575dd3
12 changed files with 179 additions and 158 deletions
+3 -14
View File
@@ -19,18 +19,7 @@ type Repository interface {
FindTags(ctx context.Context, query *TagsQuery) (FindTagsResult, error)
}
// AnnotationCleaner is responsible for cleaning up old annotations
type AnnotationCleaner interface {
CleanAnnotations(ctx context.Context, cfg *setting.Cfg) (int64, int64, error)
}
// var repositoryInstance Repository
var cleanerInstance AnnotationCleaner
func GetAnnotationCleaner() AnnotationCleaner {
return cleanerInstance
}
func SetAnnotationCleaner(rep AnnotationCleaner) {
cleanerInstance = rep
// Cleaner is responsible for cleaning up old annotations
type Cleaner interface {
Run(ctx context.Context, cfg *setting.Cfg) (int64, int64, error)
}