code_review: PR #1962

- Rename functions about auto-fetching
- Ignore all exceptions while auto-fetching

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-12-08 10:36:31 +08:00
parent ceb56d5d17
commit f763060bd6

View File

@@ -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.
}
}