From b8680e33e191037541691369ef15fdcc9223b630 Mon Sep 17 00:00:00 2001 From: MohammadReza Palide Date: Tue, 19 Dec 2023 07:34:06 +0000 Subject: [PATCH] fix issue on cancel() func calling for proxy (skysocks) and vpn-client --- cmd/skywire-cli/commands/proxy/proxy.go | 1 - cmd/skywire-cli/commands/vpn/vvpn.go | 1 - 2 files changed, 2 deletions(-) diff --git a/cmd/skywire-cli/commands/proxy/proxy.go b/cmd/skywire-cli/commands/proxy/proxy.go index 2c4ef5e82..7444d507b 100644 --- a/cmd/skywire-cli/commands/proxy/proxy.go +++ b/cmd/skywire-cli/commands/proxy/proxy.go @@ -125,7 +125,6 @@ var startCmd = &cobra.Command{ } ctx, cancel := cmdutil.SignalContext(context.Background(), &logrus.Logger{}) - defer cancel() go func() { <-ctx.Done() cancel() diff --git a/cmd/skywire-cli/commands/vpn/vvpn.go b/cmd/skywire-cli/commands/vpn/vvpn.go index 4ab463523..9adca3d5b 100644 --- a/cmd/skywire-cli/commands/vpn/vvpn.go +++ b/cmd/skywire-cli/commands/vpn/vvpn.go @@ -84,7 +84,6 @@ var startCmd = &cobra.Command{ internal.Catch(cmd.Flags(), rpcClient.StartVPNClient(pubkey)) internal.PrintOutput(cmd.Flags(), nil, "Starting.") ctx, cancel := cmdutil.SignalContext(context.Background(), &logrus.Logger{}) - defer cancel() go func() { <-ctx.Done() cancel()