From 70155af3bce03a54046d7809058716db8cc32b42 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Wed, 12 Jul 2023 10:58:27 +0200 Subject: [PATCH] Restore commented code Signed-off-by: Itxaka --- internal/agent/reset.go | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/internal/agent/reset.go b/internal/agent/reset.go index fb628e13..5284616d 100644 --- a/internal/agent/reset.go +++ b/internal/agent/reset.go @@ -49,32 +49,29 @@ func Reset(debug bool, dir ...string) error { cmd.PrintText(agentConfig.Branding.Reset, "Reset") - /* - // We don't close the lock, as none of the following actions are expected to return - lock := sync.Mutex{} - go func() { - // Wait for user input and go back to shell - utils.Prompt("") //nolint:errcheck - // give tty1 back - svc, err := machine.Getty(1) - if err == nil { - svc.Start() //nolint:errcheck - } - - lock.Lock() - fmt.Println("Reset aborted") - panic(utils.Shell().Run()) - }() - - if !agentConfig.Fast { - time.Sleep(60 * time.Second) + // We don't close the lock, as none of the following actions are expected to return + lock := sync.Mutex{} + go func() { + // Wait for user input and go back to shell + utils.Prompt("") //nolint:errcheck + // give tty1 back + svc, err := machine.Getty(1) + if err == nil { + svc.Start() //nolint:errcheck } + lock.Lock() + fmt.Println("Reset aborted") + panic(utils.Shell().Run()) + }() - ensureDataSourceReady() + if !agentConfig.Fast { + time.Sleep(60 * time.Second) + } + lock.Lock() + ensureDataSourceReady() - */ bus.Manager.Publish(sdk.EventBeforeReset, sdk.EventPayload{}) //nolint:errcheck c, err := config.Scan(collector.Directories(dir...))