storagenode: avoid starting command on service stop (#3105)

This commit is contained in:
Michal Niewrzal 2019-09-24 12:17:22 -07:00 committed by GitHub
parent 8d16349b4c
commit 366a0be6aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -12,8 +12,9 @@
package main
import (
"time"
"log"
"os"
"time"
"golang.org/x/sys/windows/svc"
)
@ -32,6 +33,8 @@ func init() {
if err != nil {
panic("Service failed: " + err.Error())
}
// avoid starting main() when service was stopped
os.Exit(0)
}
type service struct{}

View File

@ -50,6 +50,8 @@ func init() {
if err != nil {
zap.S().Fatalf("Service failed: %v", err)
}
// avoid starting main() when service was stopped
os.Exit(0)
}
type service struct{}