Skip to content

Commit

Permalink
replace deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
raskchanky committed Nov 5, 2020
1 parent 7e14512 commit 3b74e04
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions command/agent/winsvc/service_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ import (
type serviceWindows struct{}

func init() {
interactive, err := wsvc.IsAnInteractiveSession()
inService, err := wsvc.IsWindowsService()
if err != nil {
panic(err)
}

// Cannot run as a service when running interactively
if interactive {
if !inService {
return
}

go wsvc.Run("", serviceWindows{})
}

Expand Down

0 comments on commit 3b74e04

Please sign in to comment.