This commit is contained in:
Michael Quigley 2023-04-19 08:56:50 -04:00
parent a055e98ab6
commit 1177b0ec0a
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -13,7 +13,6 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"os" "os"
"os/signal" "os/signal"
"runtime/pprof"
"syscall" "syscall"
"time" "time"
) )
@ -40,13 +39,6 @@ func newAccessPrivateTunnelCommand() *accessPrivateTunnelCommand {
} }
func (cmd *accessPrivateTunnelCommand) run(_ *cobra.Command, args []string) { func (cmd *accessPrivateTunnelCommand) run(_ *cobra.Command, args []string) {
// Start CPU profiling
f, err := os.Create("cpu.pprof")
if err != nil {
panic(err)
}
pprof.StartCPUProfile(f)
zrd, err := zrokdir.Load() zrd, err := zrokdir.Load()
if err != nil { if err != nil {
tui.Error("unable to load zrokdir", err) tui.Error("unable to load zrokdir", err)
@ -96,13 +88,12 @@ func (cmd *accessPrivateTunnelCommand) run(_ *cobra.Command, args []string) {
panic(err) panic(err)
} }
for { for {
time.Sleep(50) time.Sleep(30 * 24 * time.Hour)
} }
} }
func (cmd *accessPrivateTunnelCommand) destroy(frontendName, envZId, shrToken string, zrok *rest_client_zrok.Zrok, auth runtime.ClientAuthInfoWriter) { func (cmd *accessPrivateTunnelCommand) destroy(frontendName, envZId, shrToken string, zrok *rest_client_zrok.Zrok, auth runtime.ClientAuthInfoWriter) {
logrus.Debugf("shutting down '%v'", shrToken) logrus.Debugf("shutting down '%v'", shrToken)
pprof.StopCPUProfile()
req := share.NewUnaccessParams() req := share.NewUnaccessParams()
req.Body = &rest_model_zrok.UnaccessRequest{ req.Body = &rest_model_zrok.UnaccessRequest{
FrontendToken: frontendName, FrontendToken: frontendName,