提交 acd1f1dd 编写于 作者: H Heejae Chang

rename following PR feedback

上级 0984fad3
......@@ -21,9 +21,9 @@ internal class InProcRemoteHostClient : RemoteHostClient
private readonly InProcRemoteServices _inprocServices;
private readonly JsonRpc _rpc;
public static async Task<RemoteHostClient> CreateAsync(Workspace workspace, bool forTesting, CancellationToken cancellationToken)
public static async Task<RemoteHostClient> CreateAsync(Workspace workspace, bool runCacheCleanup, CancellationToken cancellationToken)
{
var inprocServices = new InProcRemoteServices(forTesting);
var inprocServices = new InProcRemoteServices(runCacheCleanup);
var remoteHostStream = await inprocServices.RequestServiceAsync(WellKnownRemoteHostServices.RemoteHostService, cancellationToken).ConfigureAwait(false);
......@@ -88,11 +88,11 @@ public class ServiceProvider : IServiceProvider
private readonly AssetStorage _storage;
public ServiceProvider(bool forTesting)
public ServiceProvider(bool runCacheCleanup)
{
_storage = forTesting ?
new AssetStorage() :
new AssetStorage(cleanupInterval: TimeSpan.FromSeconds(30), purgeAfter: TimeSpan.FromMinutes(1));
_storage = runCacheCleanup ?
new AssetStorage(cleanupInterval: TimeSpan.FromSeconds(30), purgeAfter: TimeSpan.FromMinutes(1)) :
new AssetStorage();
}
public AssetStorage AssetStorage => _storage;
......@@ -117,9 +117,9 @@ private class InProcRemoteServices
{
private readonly ServiceProvider _serviceProvider;
public InProcRemoteServices(bool forTesting)
public InProcRemoteServices(bool runCacheCleanup)
{
_serviceProvider = new ServiceProvider(forTesting);
_serviceProvider = new ServiceProvider(runCacheCleanup);
}
public AssetStorage AssetStorage => _serviceProvider.AssetStorage;
......
......@@ -15,7 +15,7 @@ internal class InProcRemoteHostClientFactory : IRemoteHostClientFactory
{
public Task<RemoteHostClient> CreateAsync(Workspace workspace, CancellationToken cancellationToken)
{
return InProcRemoteHostClient.CreateAsync(workspace, forTesting: true, cancellationToken: cancellationToken);
return InProcRemoteHostClient.CreateAsync(workspace, runCacheCleanup: false, cancellationToken: cancellationToken);
}
}
}
......@@ -45,7 +45,7 @@ public async Task TestRemoteHostSynchronize()
using (var workspace = await TestWorkspace.CreateCSharpAsync(code))
{
var client = (InProcRemoteHostClient)(await InProcRemoteHostClient.CreateAsync(workspace, forTesting: true, cancellationToken: CancellationToken.None));
var client = (InProcRemoteHostClient)(await InProcRemoteHostClient.CreateAsync(workspace, runCacheCleanup: false, cancellationToken: CancellationToken.None));
var solution = workspace.CurrentSolution;
......@@ -63,7 +63,7 @@ public async Task TestRemoteHostSynchronizeIncrementalUpdate()
{
using (var workspace = await TestWorkspace.CreateCSharpAsync(Array.Empty<string>(), metadataReferences: null))
{
var client = (InProcRemoteHostClient)(await InProcRemoteHostClient.CreateAsync(workspace, forTesting: true, cancellationToken: CancellationToken.None));
var client = (InProcRemoteHostClient)(await InProcRemoteHostClient.CreateAsync(workspace, runCacheCleanup: false, cancellationToken: CancellationToken.None));
var solution = Populate(workspace.CurrentSolution.RemoveProject(workspace.CurrentSolution.ProjectIds.First()));
......@@ -284,7 +284,7 @@ private static Solution AddProject(Solution solution, string language, string[]
private static RemoteHostService CreateService()
{
var stream = new MemoryStream();
return new RemoteHostService(stream, new InProcRemoteHostClient.ServiceProvider(forTesting: true));
return new RemoteHostService(stream, new InProcRemoteHostClient.ServiceProvider(runCacheCleanup: false));
}
public static void SetEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual)
......
......@@ -21,7 +21,7 @@ public async Task<RemoteHostClient> CreateAsync(Workspace workspace, Cancellatio
// this is the point where we can create different kind of remote host client in future (cloud or etc)
if (workspace.Options.GetOption(RemoteHostClientFactoryOptions.RemoteHost_InProc))
{
return await InProcRemoteHostClient.CreateAsync(workspace, forTesting: false, cancellationToken: cancellationToken).ConfigureAwait(false);
return await InProcRemoteHostClient.CreateAsync(workspace, runCacheCleanup: true, cancellationToken: cancellationToken).ConfigureAwait(false);
}
return await ServiceHubRemoteHostClient.CreateAsync(workspace, cancellationToken).ConfigureAwait(false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册