Better sync log

This commit is contained in:
2025-09-18 02:04:01 +02:00
parent c199f37b14
commit 429cd2284f
18 changed files with 30 additions and 29 deletions

View File

@@ -1,3 +1,4 @@
using API.Workers;
using log4net;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
@@ -22,9 +23,9 @@ public abstract class TrangaBaseContext<T> : DbContext where T : DbContext
}, Array.Empty<string>(), LogLevel.Warning, DbContextLoggerOptions.Level | DbContextLoggerOptions.Category | DbContextLoggerOptions.UtcTime);
}
internal async Task<(bool success, string? exceptionMessage)> Sync(CancellationToken token)
internal async Task<(bool success, string? exceptionMessage)> Sync(CancellationToken token, Type? trigger = null)
{
Log.Debug($"Syncing {GetType().Name}...");
Log.Debug($"Syncing {GetType().Name} {trigger?.Name}...");
try
{
int changedRows = await this.SaveChangesAsync(token);