Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 3c8ed54

Browse files
committed
Use Forget(ILogger) from TaskExtensions
1 parent bf46b6e commit 3c8ed54

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/GitHub.App/Services/TeamExplorerContext.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using GitHub.Models;
88
using GitHub.Logging;
99
using GitHub.Primitives;
10+
using GitHub.Extensions;
1011
using Serilog;
1112
using EnvDTE;
1213
using Microsoft.VisualStudio.Shell;
@@ -72,7 +73,7 @@ public TeamExplorerContext(
7273
JoinableTaskCollection = joinableTaskContext.CreateCollection();
7374
JoinableTaskCollection.DisplayName = nameof(TeamExplorerContext);
7475
JoinableTaskFactory = joinableTaskContext.CreateFactory(JoinableTaskCollection);
75-
76+
7677
this.gitExt = gitExt;
7778
this.dteAsync = dteAsync;
7879
this.pullRequestService = pullRequestService;
@@ -81,7 +82,7 @@ public TeamExplorerContext(
8182
gitExt.ActiveRepositoriesChanged += Refresh;
8283
}
8384

84-
void StartRefresh() => JoinableTaskFactory.RunAsync(QueueRefreshAsync).Task.LogAndForget(log);
85+
void StartRefresh() => JoinableTaskFactory.RunAsync(QueueRefreshAsync).Task.Forget(log);
8586
void Refresh() => JoinableTaskFactory.Run(QueueRefreshAsync);
8687

8788
async Task QueueRefreshAsync()

src/GitHub.TeamFoundation.14/Services/VSGitExt.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using GitHub.Models;
66
using GitHub.Services;
77
using GitHub.Logging;
8+
using GitHub.Extensions;
89
using GitHub.TeamFoundation.Services;
910
using Serilog;
1011
using Microsoft.VisualStudio.Shell;
@@ -53,7 +54,7 @@ public VSGitExt(IAsyncServiceProvider asyncServiceProvider, IVSUIContextFactory
5354
// The IGitExt service isn't available when a TFS based solution is opened directly.
5455
// It will become available when moving to a Git based solution (and cause a UIContext event to fire).
5556
var context = factory.GetUIContext(new Guid(Guids.GitSccProviderId));
56-
context.WhenActivated(() => JoinableTaskFactory.RunAsync(InitializeAsync).Task.LogAndForget(log));
57+
context.WhenActivated(() => JoinableTaskFactory.RunAsync(InitializeAsync).Task.Forget(log));
5758
}
5859

5960
async Task InitializeAsync()

0 commit comments

Comments
 (0)