Logging for Job-Cycle

This commit is contained in:
Glax 2025-05-16 21:27:02 +02:00
parent 5a6dc5a5b2
commit 49b382fe1f

View File

@ -107,7 +107,10 @@ public static class Tranga
PgsqlContext context = scope.ServiceProvider.GetRequiredService<PgsqlContext>(); PgsqlContext context = scope.ServiceProvider.GetRequiredService<PgsqlContext>();
while (true) while (true)
{ Log.Debug("Loading Jobs..."); {
Log.Debug("Starting Job-Cycle...");
DateTime cycleStart = DateTime.UtcNow;
Log.Debug("Loading Jobs...");
DateTime loadStart = DateTime.UtcNow; DateTime loadStart = DateTime.UtcNow;
context.Jobs.Load(); context.Jobs.Load();
Log.Debug("Updating Entries..."); Log.Debug("Updating Entries...");
@ -198,6 +201,7 @@ public static class Tranga
{ {
Log.Error("Failed saving Job changes.", e); Log.Error("Failed saving Job changes.", e);
} }
Log.Debug($"Job-Cycle over! (took {DateTime.UtcNow.Subtract(cycleStart).TotalMilliseconds}ms)");
Thread.Sleep(TrangaSettings.startNewJobTimeoutMs); Thread.Sleep(TrangaSettings.startNewJobTimeoutMs);
} }
} }