mirror of
https://github.com/spaytac/orbiter.git
synced 2026-01-21 20:14:41 +00:00
Fixed bad messages syntax
I was investigating on #34 and I discover some wrong messages. This PR fixed them but it's not fixing the root cause #34.
This commit is contained in:
parent
4f796064eb
commit
1c9598b048
@ -66,7 +66,7 @@ func (p SwarmProvider) Scale(serviceId string, target int, direction bool) error
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"error": err.Error(),
|
||||
"provider": "swarm",
|
||||
}).Info("Service %s is not scaling.", serviceId)
|
||||
}).Infof("Service %s is not scaling.", serviceId)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ func (p SwarmProvider) Scale(serviceId string, target int, direction bool) error
|
||||
|
||||
// This function validate if a request is acceptable or not.
|
||||
func (p *SwarmProvider) isAcceptable(tasks []swarm.Task, target int, direction bool) error {
|
||||
if p.calculateActiveTasks(tasks) < target || p.calculateActiveTasks(tasks) < 2 && direction == false {
|
||||
if direction == false && (p.calculateActiveTasks(tasks) < target || p.calculateActiveTasks(tasks) < 2) {
|
||||
return errors.New(fmt.Sprintf("I can not scale down because it has only %d running.", target))
|
||||
}
|
||||
return nil
|
||||
|
||||
Loading…
Reference in New Issue
Block a user