|
|
@ -28,7 +28,6 @@ const ( |
|
|
|
acceptHammerCode = svc.Accepted(hammerCode) |
|
|
|
acceptHammerCode = svc.Accepted(hammerCode) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type gracefulManager struct { |
|
|
|
type gracefulManager struct { |
|
|
|
isChild bool |
|
|
|
isChild bool |
|
|
|
lock *sync.RWMutex |
|
|
|
lock *sync.RWMutex |
|
|
@ -73,7 +72,7 @@ func (g *gracefulManager) Execute(args []string, changes <-chan svc.ChangeReques |
|
|
|
if setting.StartupTimeout > 0 { |
|
|
|
if setting.StartupTimeout > 0 { |
|
|
|
status <- svc.Status{State: svc.StartPending} |
|
|
|
status <- svc.Status{State: svc.StartPending} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
status <- svc.Status{State: svc.StartPending, WaitHint: uint32(setting.StartupTimeout/time.Millisecond)} |
|
|
|
status <- svc.Status{State: svc.StartPending, WaitHint: uint32(setting.StartupTimeout / time.Millisecond)} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Now need to wait for everything to start...
|
|
|
|
// Now need to wait for everything to start...
|
|
|
@ -100,7 +99,7 @@ loop: |
|
|
|
break loop |
|
|
|
break loop |
|
|
|
case hammerCode: |
|
|
|
case hammerCode: |
|
|
|
g.doShutdown() |
|
|
|
g.doShutdown() |
|
|
|
g.doHammerTime(0 *time.Second) |
|
|
|
g.doHammerTime(0 * time.Second) |
|
|
|
break loop |
|
|
|
break loop |
|
|
|
default: |
|
|
|
default: |
|
|
|
log.Debug("Unexpected control request: %v", change.Cmd) |
|
|
|
log.Debug("Unexpected control request: %v", change.Cmd) |
|
|
@ -108,8 +107,8 @@ loop: |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
status <- svc.Status{ |
|
|
|
status <- svc.Status{ |
|
|
|
State: svc.StopPending, |
|
|
|
State: svc.StopPending, |
|
|
|
WaitHint: uint32(waitTime/time.Millisecond), |
|
|
|
WaitHint: uint32(waitTime / time.Millisecond), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
hammerLoop: |
|
|
|
hammerLoop: |
|
|
|