[REV] set restart controller timeout is 5m

This commit is contained in:
barnett 2019-03-24 18:50:51 +08:00
parent 6b2bd4c316
commit bdd6a87716
2 changed files with 7 additions and 1 deletions

View File

@ -55,8 +55,10 @@ func (s *restartController) Begin() {
s.manager.callback(s.controllerID, nil)
}
func (s *restartController) restartOne(app v1.AppService) error {
stopController := stopController{
//Restart the control set timeout interval is 5m
stopController := &stopController{
manager: s.manager,
waiting: time.Minute * 5,
}
if err := stopController.stopOne(app); err != nil {
app.Logger.Error("(Restart)Stop app failure %s,you could waiting stoped and manual start it", GetCallbackLoggerOption())

View File

@ -35,6 +35,7 @@ type stopController struct {
controllerID string
appService []v1.AppService
manager *Manager
waiting time.Duration
}
func (s *stopController) Begin() {
@ -143,6 +144,9 @@ func (s *stopController) WaitingReady(app v1.AppService) error {
if storeAppService != nil && storeAppService.Replicas > 0 {
timeout = time.Duration(storeAppService.Replicas) * timeout
}
if s.waiting != 0 {
timeout = s.waiting
}
if err := WaitStop(s.manager.store, storeAppService, timeout, app.Logger, s.stopChan); err != nil {
return err
}