Skip to content

Commit

Permalink
🐛 fix win service check
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev committed Nov 20, 2024
1 parent eafe0a9 commit c514e02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/cnspec/cmd/backgroundjob/serve_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import (
)

func Serve(timer time.Duration, splay time.Duration, handler JobRunner) {
isIntSess, err := svc.IsWindowsService()
isService, err := svc.IsWindowsService()
if err != nil {
log.Fatal().Err(err).Msg("failed to determine if we are running in an interactive session")
}
// if it is an service ...
if !isIntSess {
if isService {
// set windows eventlogger
w, err := eventlog.NewEventlogWriter(SvcName)
if err != nil {
Expand Down

0 comments on commit c514e02

Please sign in to comment.