[postgres-Server-V2] feat(Jobs): Instead of passing context to each job, pass service provider and let the job create its own context

This commit is contained in:
Alessandro Benetton
2025-02-01 23:08:13 +01:00
parent a69e12179b
commit 725813c2f3
3 changed files with 22 additions and 14 deletions

View File

@ -124,7 +124,7 @@ using (var scope = app.Services.CreateScope())
TrangaSettings.Load();
Tranga.StartLogger();
Tranga.JobStarterThread.Start(app.Services.CreateScope().ServiceProvider.GetService<PgsqlContext>());
Tranga.JobStarterThread.Start(app.Services);
Tranga.NotificationSenderThread.Start(app.Services.CreateScope().ServiceProvider.GetService<PgsqlContext>());
app.UseCors("AllowAll");