This commit is contained in:
Alex Dadgar
2017-05-01 15:06:18 -07:00
parent 4d6a012c6f
commit 7dee8ae534
2 changed files with 28 additions and 14 deletions

View File

@@ -645,15 +645,26 @@ func (c *Client) saveState() error {
return nil
}
var mErr multierror.Error
for id, ar := range c.getAllocRunners() {
if err := ar.SaveState(); err != nil {
c.logger.Printf("[ERR] client: failed to save state for alloc %s: %v",
id, err)
mErr.Errors = append(mErr.Errors, err)
}
go func() {
local := ar
if err := local.SaveState(); err != nil {
c.logger.Printf("[ERR] client: failed to save state for alloc %s: %v",
id, err)
}
}()
}
return mErr.ErrorOrNil()
return nil
//var mErr multierror.Error
//for id, ar := range c.getAllocRunners() {
//if err := ar.SaveState(); err != nil {
//c.logger.Printf("[ERR] client: failed to save state for alloc %s: %v",
//id, err)
//mErr.Errors = append(mErr.Errors, err)
//}
//}
//return mErr.ErrorOrNil()
}
// getAllocRunners returns a snapshot of the current set of alloc runners.