mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-03 04:07:51 +08:00
[REV] set restart controller timeout is 5m
This commit is contained in:
parent
6b2bd4c316
commit
bdd6a87716
@ -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())
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user