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
|
|
@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Hosting;
|
|||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
|
|
@ -22,6 +23,11 @@ public class Program
|
|||
var metrics = services.GetRequiredService<MareMetrics>();
|
||||
|
||||
metrics.SetGaugeTo(MetricsAPI.GaugeUsersRegistered, dbContext.Users.Count());
|
||||
|
||||
var options = host.Services.GetService<IOptions<ServicesConfiguration>>();
|
||||
var logger = host.Services.GetService<ILogger<Program>>();
|
||||
logger.LogInformation("Loaded MareSynchronos Services Configuration");
|
||||
logger.LogInformation(options.Value.ToString());
|
||||
}
|
||||
|
||||
host.Run();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue