mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-23 02:12:25 +08:00
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:
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user