mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-24 17:24:14 -05:00
Add functionality to shutdown Kusto process when parent process exits (#1609)
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
<PropertyGroup Condition="'$(BUILD_DOTNET_TOOL)' == 'true'">
|
||||
<PackageId>Microsoft.SqlServer.KustoServiceLayer.Tool</PackageId>
|
||||
<PackageVersion>1.0.0</PackageVersion>
|
||||
<PackageVersion>1.1.0</PackageVersion>
|
||||
<PackageDescription>.NET client Kusto Service application, usable as a dotnet tool. This package is intended to be used by internal applications only and should not be referenced directly.</PackageDescription>
|
||||
<PackAsTool>true</PackAsTool>
|
||||
<ToolCommandName>$(AssemblyName)</ToolCommandName>
|
||||
|
||||
@@ -48,6 +48,12 @@ namespace Microsoft.Kusto.ServiceLayer
|
||||
SqlToolsContext sqlToolsContext = new SqlToolsContext(hostDetails);
|
||||
ServiceHost serviceHost = HostLoader.CreateAndStartServiceHost(sqlToolsContext);
|
||||
|
||||
// If this service was started by another process, then it should shutdown when that parent process does.
|
||||
if (commandOptions.ParentProcessId != null)
|
||||
{
|
||||
ProcessExitTimer.Start(commandOptions.ParentProcessId.Value);
|
||||
}
|
||||
|
||||
serviceHost.WaitForExit();
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user