0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-08-22 19:28:34 +00:00

fix: add variable for getting inactive users

fixes #25
This commit is contained in:
Alexander Konietzko 2023-09-01 23:37:26 +02:00
parent 864d1e812c
commit b4020cf80e
No known key found for this signature in database
GPG Key ID: BA6905F37AEC2B5B

View File

@ -37,9 +37,11 @@ public sealed class SetInactiveUsersService : BackgroundService
try
{
var cutoffDate = DateTimeOffset.UtcNow.AddDays(-30);
inactiveUsers = await context.Users
.Where(user =>
user.LastLoggedinDate < DateTime.UtcNow.AddDays(-30) &&
user.LastLoggedinDate < cutoffDate &&
user.Status == UserStatus.Active)
.Take(250)
.ToListAsync(stoppingToken);