mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 16:27:23 +01:00
switch around all iconfiguration usage to ioptions
This commit is contained in:
parent
b8d61b38bd
commit
7ee7fdaf48
21 changed files with 218 additions and 99 deletions
|
|
@ -12,7 +12,6 @@ using Prometheus;
|
|||
using MareSynchronosShared.Models;
|
||||
using MareSynchronosServices.Identity;
|
||||
using MareSynchronosShared.Metrics;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Net.Http;
|
||||
using MareSynchronosShared.Utils;
|
||||
using System.Collections.Generic;
|
||||
|
|
@ -758,9 +757,9 @@ public class MareModule : InteractionModuleBase
|
|||
user.IsAdmin = true;
|
||||
}
|
||||
|
||||
if (_botServices.Configuration.GetValue<bool>("PurgeUnusedAccounts"))
|
||||
if (_botServices.Configuration.PurgeUnusedAccounts)
|
||||
{
|
||||
var purgedDays = _botServices.Configuration.GetValue<int>("PurgeUnusedAccountsPeriodInDays");
|
||||
var purgedDays = _botServices.Configuration.PurgeUnusedAccountsPeriodInDays;
|
||||
user.LastLoggedIn = DateTime.UtcNow - TimeSpan.FromDays(purgedDays) + TimeSpan.FromDays(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue