Closed ben-jacobs closed 7 years ago
If the server time isn't set to UTC, then Tokens can be potentially cleaned up before expected (e.g. in +10:30 they effectively get cleaned up immediately. Changing DateTimeOffset.Now to DateTimeOffset.UtcNow appears to fix the problem.
Cheers Ben
private async Task ClearTokens() { try { Logger.Info("Clearing tokens"); await options.Store.AsyncDatabaseCommands.DeleteByIndexAsync("TokenCleanupIndex", new IndexQuery { Query = "Expires:[* TO \"" + DateTimeOffset.UtcNow.ToString("s") + "\"]" }, new BulkOperationOptions { AllowStale = true }); } catch (Exception ex) { Logger.ErrorException("Exception cleaning tokens", ex); } }
Thanks. Should be fixed in this commit: 9e38bd3ce8eaba07392bbfe113ecb84d8ec4ad26
If the server time isn't set to UTC, then Tokens can be potentially cleaned up before expected (e.g. in +10:30 they effectively get cleaned up immediately. Changing DateTimeOffset.Now to DateTimeOffset.UtcNow appears to fix the problem.
Cheers Ben