From f763060bd678cbc38bc96eccdab5a28fd1d091fc Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 8 Dec 2025 10:36:31 +0800 Subject: [PATCH] code_review: PR #1962 - Rename functions about auto-fetching - Ignore all exceptions while auto-fetching Signed-off-by: leo --- src/ViewModels/Repository.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index c3ed2d40..3f8c26ee 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -509,7 +509,7 @@ namespace SourceGit.ViewModels } _lastFetchTime = DateTime.Now; - _autoFetchTimer = new Timer(FetchInBackground, null, 5000, 5000); + _autoFetchTimer = new Timer(AutoFetchByTimer, null, 5000, 5000); RefreshAll(); } @@ -1812,12 +1812,12 @@ namespace SourceGit.ViewModels return null; } - private void FetchInBackground(object sender) + private void AutoFetchByTimer(object sender) { - Dispatcher.UIThread.Invoke(FetchInBackgroundOnUiThread); + Dispatcher.UIThread.Invoke(AutoFetchOnUIThread); } - private async Task FetchInBackgroundOnUiThread() + private async Task AutoFetchOnUIThread() { try { @@ -1862,9 +1862,9 @@ namespace SourceGit.ViewModels _lastFetchTime = DateTime.Now; IsAutoFetching = false; } - catch (OperationCanceledException) + catch { - // Ignore cancellation. + // Ignore all exceptions. } }