BaseWorker, BaseWorkerWithContext DoWork, call: Scope setting

TrangaBaseContext Sync return with success state and exception message
This commit is contained in:
2025-07-02 22:15:34 +02:00
parent 6cd836540a
commit e327e93163
19 changed files with 125 additions and 99 deletions

View File

@ -22,17 +22,17 @@ public abstract class TrangaBaseContext<T> : DbContext where T : DbContext
}, Array.Empty<string>(), LogLevel.Warning, DbContextLoggerOptions.Level | DbContextLoggerOptions.Category | DbContextLoggerOptions.UtcTime);
}
internal async Task<string?> Sync()
internal async Task<(bool success, string? exceptionMessage)> Sync()
{
try
{
await this.SaveChangesAsync();
return null;
return (true, null);
}
catch (Exception e)
{
Log.Error(null, e);
return e.Message;
return (false, e.Message);
}
}
}