smarter "clean remote files"

this should (optionally) skip in-use files, and files that have been
seen recently
This commit is contained in:
dakkar 2025-06-24 15:34:13 +01:00
parent a4c0ef824c
commit c68b8d6e7c
3 changed files with 49 additions and 19 deletions

View file

@ -684,8 +684,11 @@ export class QueueService {
}
@bindThis
public createCleanRemoteFilesJob() {
return this.objectStorageQueue.add('cleanRemoteFiles', {}, {
public createCleanRemoteFilesJob(olderThanSeconds: number = 0, keepFilesInUse: boolean = false) {
return this.objectStorageQueue.add('cleanRemoteFiles', {
keepFilesInUse,
olderThanSeconds,
}, {
removeOnComplete: {
age: 3600 * 24 * 7, // keep up to 7 days
count: 30,