Skip to content
This repository was archived by the owner on Jul 28, 2020. It is now read-only.

Commit 2ac184f

Browse files
Andy VoellmerAnthony Emengo
authored andcommitted
removed retry logic from winsw service stopping, and removed debug statements
Signed-off-by: Anthony Emengo <[email protected]>
1 parent dc5ee62 commit 2ac184f

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

acceptance/privileged/cfdev_lifecycle_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,7 @@ func streamKinesis(analyticsChan chan string) {
276276
eventTime, err := time.Parse(time.RFC3339, analyticsEvent.Timestamp)
277277
tenMinutesAgo := time.Now().UTC().Add(-10 * time.Minute)
278278
if eventTime.After(tenMinutesAgo) {
279-
fmt.Printf("DEBUG: EVENT RECEIVED: `%v` event user:`%v` current user:`%v`\n", analyticsEvent.Event, analyticsEvent.UserId, userID)
280279
if analyticsEvent.UserId == userID {
281-
fmt.Printf("DEBUG: Add the event `%v` to the channel!!\n", analyticsEvent.Event)
282280
analyticsChan <- analyticsEvent.Event
283281
}
284282
}

cmd/stop/stop.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package stop
22

33
import (
4-
"fmt"
54
"runtime"
65

76
"code.cloudfoundry.org/cfdev/cfanalytics"
@@ -104,7 +103,6 @@ func (s *Stop) RunE(cmd *cobra.Command, args []string) error {
104103
reterr = errors.SafeWrap(err, "failed to stop vpnkit")
105104
}
106105

107-
fmt.Printf("DEBUG: STOP: FINISHED STOPPING & ABOUT TO DESTROY VPNKIT \n")
108106
if err := s.VpnKit.Destroy(); err != nil {
109107
reterr = errors.SafeWrap(err, "failed to destroy vpnkit")
110108
}

daemon/winsw_windows.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"os/exec"
1010
"path/filepath"
1111
"strings"
12-
"time"
1312
)
1413

1514
type WinSW struct {
@@ -93,16 +92,14 @@ func (w *WinSW) Start(label string) error {
9392
func (w *WinSW) Stop(label string) error {
9493
var executablePath string
9594
running, _ := w.IsRunning(label)
96-
for running {
95+
if running {
9796
_, executablePath = getServicePaths(label, w.ServicesDir)
9897

9998
cmd := exec.Command(executablePath, "stop")
10099
err := runCommand(cmd)
101100
if err != nil {
102101
return err
103102
}
104-
time.Sleep(4 * time.Second)
105-
running, _ = w.IsRunning(label)
106103
}
107104
return nil
108105
}
@@ -177,7 +174,6 @@ func isInstalled(label string) bool {
177174

178175
func runCommand(command *exec.Cmd) error {
179176
output, err := command.CombinedOutput()
180-
fmt.Printf("DEBUG: OUTPUT FROM TRYING TO STOP SERVICE: %v\n", string(output))
181177
if err != nil {
182178
return fmt.Errorf("Failed to execute %s, %v: %s: %s", command.Path, command.Args, err, string(output))
183179
}

0 commit comments

Comments
 (0)