projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
9944: Tweak centos6 Dockerfiles to fall back to mirror if repoforge main is
[arvados.git]
/
services
/
keep-balance
/
main.go
diff --git
a/services/keep-balance/main.go
b/services/keep-balance/main.go
index 364bb3ffd3f6b437ec1d46edf52223539fb1161b..da4fb62a6ac8f0772e550c5eb2a103de7904ad7e 100644
(file)
--- a/
services/keep-balance/main.go
+++ b/
services/keep-balance/main.go
@@
-51,6
+51,12
@@
type RunOptions struct {
CommitTrash bool
Logger *log.Logger
Dumper *log.Logger
CommitTrash bool
Logger *log.Logger
Dumper *log.Logger
+
+ // SafeRendezvousState from the most recent balance operation,
+ // or "" if unknown. If this changes from one run to the next,
+ // we need to watch out for races. See
+ // (*Balancer)ClearTrashLists.
+ SafeRendezvousState string
}
var debugf = func(string, ...interface{}) {}
}
var debugf = func(string, ...interface{}) {}
@@
-98,7
+104,7
@@
func main() {
if err != nil {
// (don't run)
} else if runOptions.Once {
if err != nil {
// (don't run)
} else if runOptions.Once {
- err = (&Balancer{}).Run(config, runOptions)
+
_,
err = (&Balancer{}).Run(config, runOptions)
} else {
err = RunForever(config, runOptions, nil)
}
} else {
err = RunForever(config, runOptions, nil)
}
@@
-138,7
+144,9
@@
func RunForever(config Config, runOptions RunOptions, stop <-chan interface{}) e
logger.Print("======= Consider using -commit-pulls and -commit-trash flags.")
}
logger.Print("======= Consider using -commit-pulls and -commit-trash flags.")
}
- err := (&Balancer{}).Run(config, runOptions)
+ bal := &Balancer{}
+ var err error
+ runOptions, err = bal.Run(config, runOptions)
if err != nil {
logger.Print("run failed: ", err)
} else {
if err != nil {
logger.Print("run failed: ", err)
} else {