Ejemplo n.º 1
0
        private static async Task ClearExpiredSessions()
        {
            int deleted = await DbClient.DeleteAsync("sessions", $"(expires + {SessionLifespan.Ticks}) < {DateTime.UtcNow.Ticks}");

            if (deleted > 0)
            {
                Console.WriteLine($"Deleted {deleted} expired sessions");
            }
        }