[backend/drive] Don't fixup media created since the start of the job

This prevents a race condition when the server is running during the operation.
This commit is contained in:
Laura Hausmann 2024-10-19 00:57:44 +02:00
parent b21d9691e5
commit bfd0feaf95
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -146,7 +146,7 @@ public class StorageMaintenanceService(
public async Task FixupMedia(bool dryRun)
{
var query = db.DriveFiles.Where(p => !p.IsLink && p.Uri != null);
var query = db.DriveFiles.Where(p => !p.IsLink && p.Uri != null && p.CreatedAt < DateTime.UtcNow);
var total = await query.CountAsync();
var progress = 0;
var modified = 0;