mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 12:33:35 +01:00
tunnel cli: add --parent-process-id option (#163935)
* tunnel cli: add --parent-process-id option * Update cli/src/commands/args.rs Co-authored-by: Connor Peet <connor@peet.io> * Change parent process check interval to 2s Co-authored-by: Connor Peet <connor@peet.io>
This commit is contained in:
committed by
GitHub
parent
5e170fc758
commit
c6188602f4
@@ -2,6 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
use crate::commands::tunnels::ShutdownSignal;
|
||||
use crate::constants::{CONTROL_PORT, PROTOCOL_VERSION, VSCODE_CLI_VERSION};
|
||||
use crate::log;
|
||||
use crate::self_update::SelfUpdate;
|
||||
@@ -23,7 +24,7 @@ use std::sync::Arc;
|
||||
use std::time::Instant;
|
||||
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, BufReader};
|
||||
use tokio::pin;
|
||||
use tokio::sync::{mpsc, oneshot, Mutex};
|
||||
use tokio::sync::{mpsc, Mutex};
|
||||
|
||||
use super::code_server::{
|
||||
AnyCodeServer, CodeServerArgs, ServerBuilder, ServerParamsRaw, SocketCodeServer,
|
||||
@@ -181,7 +182,7 @@ pub async fn serve(
|
||||
launcher_paths: &LauncherPaths,
|
||||
code_server_args: &CodeServerArgs,
|
||||
platform: Platform,
|
||||
shutdown_rx: oneshot::Receiver<()>,
|
||||
shutdown_rx: mpsc::Receiver<ShutdownSignal>,
|
||||
) -> Result<ServerTermination, AnyError> {
|
||||
let mut port = tunnel.add_port_direct(CONTROL_PORT).await?;
|
||||
print_listening(log, &tunnel.name);
|
||||
@@ -194,8 +195,8 @@ pub async fn serve(
|
||||
|
||||
loop {
|
||||
tokio::select! {
|
||||
_ = &mut shutdown_rx => {
|
||||
info!(log, "Received interrupt, shutting down...");
|
||||
Some(r) = shutdown_rx.recv() => {
|
||||
info!(log, "Shutting down: {}", r );
|
||||
drop(signal_exit);
|
||||
return Ok(ServerTermination {
|
||||
respawn: false,
|
||||
|
||||
Reference in New Issue
Block a user