1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-10-05 01:43:22 +08:00

Delete zombie sessions and instances (#71)

This commit is contained in:
Jonathan Leibiusky
2016-12-17 12:48:15 -08:00
committed by Marcos Nils
parent 93226e30ff
commit 54045d02f6
7 changed files with 65 additions and 33 deletions

View File

@@ -1,12 +1,18 @@
package services
import "log"
type checkUsedPortsTask struct {
}
func (c checkUsedPortsTask) Run(i *Instance) {
func (c checkUsedPortsTask) Run(i *Instance) error {
if ports, err := GetUsedPorts(i); err == nil {
for _, p := range ports {
i.setUsedPort(p)
}
} else {
log.Println(err)
return err
}
return nil
}