Fixed not call port forwarding methods if spin up/down operations fail.
This commit is contained in:
parent
b31b18674c
commit
782072e3fa
@ -79,14 +79,16 @@ func (me *ServerManager) serveAction(action int) bool {
|
||||
switch action {
|
||||
case SERVERMANAGER_SPINUP:
|
||||
ip, err := me.server.Spinup(me.name)
|
||||
if err == nil {
|
||||
me.addPortForwards(ip)
|
||||
if err != nil {
|
||||
} else {
|
||||
log.Println("ServerManager: Could not spin up "+me.name+":", err)
|
||||
}
|
||||
case SERVERMANAGER_SPINDOWN:
|
||||
err := me.server.Spindown(me.name)
|
||||
if err == nil {
|
||||
me.rmPortForwards()
|
||||
if err != nil {
|
||||
} else {
|
||||
log.Println("ServerManager: Could not spin down "+me.name+":", err)
|
||||
}
|
||||
case SERVERMANAGER_STOP:
|
||||
|
Loading…
Reference in New Issue
Block a user