mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-23 01:25:42 -05:00
added a binding queue for oe to force one operation on a node at a time (#441)
* added a binding queue for oe to force one operation on a node at a time * setting node subtype to temporal for temporal tables * disposing oe service on shutdown
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.Credentials;
|
||||
using Microsoft.SqlTools.Extensibility;
|
||||
using Microsoft.SqlTools.Hosting;
|
||||
@@ -112,12 +113,23 @@ namespace Microsoft.SqlTools.ServiceLayer
|
||||
provider.RegisterSingleService(service.ServiceType, service);
|
||||
}
|
||||
|
||||
ServiceHost serviceHost = host as ServiceHost;
|
||||
foreach (IHostedService service in provider.GetServices<IHostedService>())
|
||||
{
|
||||
// Initialize all hosted services, and register them in the service provider for their requested
|
||||
// service type. This ensures that when searching for the ConnectionService you can get it without
|
||||
// searching for an IHostedService of type ConnectionService
|
||||
service.InitializeService(host);
|
||||
|
||||
IDisposable disposable = service as IDisposable;
|
||||
if (serviceHost != null && disposable != null)
|
||||
{
|
||||
serviceHost.RegisterShutdownTask(async (shutdownParams, shutdownRequestContext) =>
|
||||
{
|
||||
disposable.Dispose();
|
||||
await Task.FromResult(0);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user