cleanups for "forge normal"
This commit is contained in:
parent
a84db9a788
commit
f754a93493
24
doNormal.go
24
doNormal.go
|
@ -6,16 +6,32 @@ package main
|
|||
// checks that repos are in a "normal" state
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go.wit.com/lib/protobuf/gitpb"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
func doNormal() bool {
|
||||
if allerr := me.forge.RillRepos(checkNormalRepoState); len(allerr) != 0 {
|
||||
log.Info("Some repos are not in a 'normal' state. error count =", len(allerr))
|
||||
for repo, err := range allerr {
|
||||
log.Info("ABNORMAL:", repo.GetFullPath(), err)
|
||||
doCheckDirtyAndConfigSave()
|
||||
|
||||
var count int
|
||||
stats := me.forge.RillRepos(checkNormalRepoState)
|
||||
for path, stat := range stats {
|
||||
dur := stat.End.Sub(stat.Start)
|
||||
if dur > time.Second {
|
||||
log.Infof("%-30v %s took a long time\n", dur, path)
|
||||
}
|
||||
if stat.Err == nil {
|
||||
continue
|
||||
}
|
||||
// log.Infof("%-60s, %-60s %v %s\n", stat.Start, stat.End.String(), dur, path)
|
||||
log.Infof("%-30v %s %v\n", dur, path, stat.Err)
|
||||
// log.Info("got path", path, stat.Err)
|
||||
count += 1
|
||||
}
|
||||
if count > 0 {
|
||||
log.Info("Some repos are not in a 'normal' state. error count =", count)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue