Sync reason System.Reflection.MethodBase.GetCurrentMethod()?.Name

This commit is contained in:
2025-09-18 02:28:59 +02:00
parent 95a75bfbcb
commit e4263e4b2b
20 changed files with 40 additions and 39 deletions

View File

@@ -19,7 +19,7 @@ public class RemoveOldNotificationsWorker(TimeSpan? interval = null, IEnumerable
Log.Debug($"Removing {toRemove.Count} old notifications...");
DbContext.RemoveRange(toRemove);
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
return [];

View File

@@ -33,7 +33,7 @@ public class SendNotificationsWorker(TimeSpan? interval = null, IEnumerable<Base
Log.Debug("Notifications sent.");
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
return [];

View File

@@ -28,7 +28,7 @@ public class UpdateChaptersDownloadedWorker(TimeSpan? interval = null, IEnumerab
}
}
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
return [];

View File

@@ -37,7 +37,7 @@ public class UpdateMetadataWorker(TimeSpan? interval = null, IEnumerable<BaseWor
}
Log.Debug("Updated metadata.");
if(await DbContext.Sync(CancellationToken, GetType()) is { success: false } e)
if(await DbContext.Sync(CancellationToken, GetType(), System.Reflection.MethodBase.GetCurrentMethod()?.Name) is { success: false } e)
Log.Error($"Failed to save database changes: {e.exceptionMessage}");
return [];