mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 11:59:48 +00:00
Made the service provider available by the program class
This commit is contained in:
parent
d24f59a837
commit
3b80462536
@ -21,6 +21,7 @@ internal sealed class Program
|
||||
public static RustService RUST_SERVICE = null!;
|
||||
public static Encryption ENCRYPTION = null!;
|
||||
public static string API_TOKEN = null!;
|
||||
public static IServiceProvider SERVICE_PROVIDER = null!;
|
||||
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
@ -148,6 +149,10 @@ internal sealed class Program
|
||||
var programLogger = app.Services.GetRequiredService<ILogger<Program>>();
|
||||
programLogger.LogInformation("Starting the AI Studio server.");
|
||||
|
||||
// Store the service provider (DI). We need it later for some classes,
|
||||
// which are not part of the request pipeline:
|
||||
SERVICE_PROVIDER = app.Services;
|
||||
|
||||
// Initialize the encryption service:
|
||||
programLogger.LogInformation("Initializing the encryption service.");
|
||||
var encryptionLogger = app.Services.GetRequiredService<ILogger<Encryption>>();
|
||||
|
Loading…
Reference in New Issue
Block a user