-
-
Notifications
You must be signed in to change notification settings - Fork 74
Closed
Labels
Description
Hi.
I'm using openiddict-core and I'm having an issue when they try to prune all inactive connections.
They are using this query
var date = threshold.UtcDateTime;
var tokens = await
(from token in Tokens.AsTracking()
where token.CreationDate < date
where (token.Status != Statuses.Inactive && token.Status != Statuses.Valid) ||
(token.Authorization != null && token.Authorization.Status != Statuses.Valid) ||
token.ExpirationDate < DateTime.UtcNow
orderby token.Id
select token).Take(1_000).ToListAsync(cancellationToken);
I've fixed changing to this
var date = threshold.UtcDateTime;
var expirationDate = DateTime.UtcNow;
var tokens = await
(from token in Tokens.AsTracking()
where token.CreationDate < date
where (token.Status != Statuses.Inactive && token.Status != Statuses.Valid) ||
(token.Authorization != null && token.Authorization.Status != Statuses.Valid) ||
token.ExpirationDate < expirationDate
orderby token.Id
select token).Take(1_000).ToListAsync(cancellationToken);
As you can see on their issue: openiddict/openiddict-core#1507 (comment)
They asked me to create this issue here to verify if you intend to translate DateTime.UtcNow
inside queries.
Thank you in advance.