cli: read tunnel lock from product.json (#179800)

Fixes #179265
This commit is contained in:
Connor Peet
2023-04-12 10:52:37 -07:00
committed by GitHub
parent c53e658dc5
commit ca9404bd2f
5 changed files with 12 additions and 19 deletions

View File

@@ -20,7 +20,7 @@ use super::{
use crate::{
async_pipe::socket_stream_split,
auth::Auth,
constants::{APPLICATION_NAME, TUNNEL_NO_SERVICE_LOCK_NAME, TUNNEL_SERVICE_LOCK_NAME},
constants::{APPLICATION_NAME, TUNNEL_CLI_LOCK_NAME, TUNNEL_SERVICE_LOCK_NAME},
json_rpc::{new_json_rpc, start_json_rpc},
log,
singleton::connect_as_client,
@@ -149,7 +149,7 @@ pub async fn service(
manager.show_logs().await?;
}
TunnelServiceSubCommands::InternalRun => {
let _lock = AppMutex::new(TUNNEL_SERVICE_LOCK_NAME);
let _lock = TUNNEL_SERVICE_LOCK_NAME.map(AppMutex::new);
manager
.run(ctx.paths.clone(), TunnelServiceContainer::new(ctx.args))
.await?;
@@ -386,7 +386,7 @@ async fn serve_with_csa(
let mut server =
make_singleton_server(log_broadcast.clone(), log.clone(), server, shutdown.clone());
let platform = spanf!(log, log.span("prereq"), PreReqChecker::new().verify())?;
let _lock = AppMutex::new(TUNNEL_NO_SERVICE_LOCK_NAME).unwrap();
let _lock = TUNNEL_CLI_LOCK_NAME.map(AppMutex::new);
let auth = Auth::new(&paths, log.clone());
let mut dt = dev_tunnels::DevTunnels::new(&log, auth, &paths);