mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 16:57:22 +01:00
remove time from linq query
This commit is contained in:
parent
eb614a5176
commit
0c3bb89456
1 changed files with 2 additions and 1 deletions
|
|
@ -83,7 +83,8 @@ public class FileCleanupService : IHostedService
|
|||
|
||||
private void CleanUpStuckUploads(MareDbContext dbContext)
|
||||
{
|
||||
var stuckUploads = dbContext.Files.Where(f => !f.Uploaded && f.UploadDate < DateTime.UtcNow.Subtract(TimeSpan.FromMinutes(10)));
|
||||
var pastTime = DateTime.UtcNow.Subtract(TimeSpan.FromMinutes(10));
|
||||
var stuckUploads = dbContext.Files.Where(f => !f.Uploaded && f.UploadDate < pastTime);
|
||||
dbContext.Files.RemoveRange(stuckUploads);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue