might show branch age in table finally
This commit is contained in:
parent
f29f25b9b7
commit
58c64cd53b
|
@ -179,7 +179,7 @@ func (f *Forge) printRepoToTable(repo *gitpb.Repo) {
|
||||||
|
|
||||||
// ctime := repo.Tags.GetAge(mhort)
|
// ctime := repo.Tags.GetAge(mhort)
|
||||||
// age := shell.FormatDuration(time.Since(ctime))
|
// age := shell.FormatDuration(time.Since(ctime))
|
||||||
age := shell.FormatDuration(repo.NewestAge())
|
age := shell.FormatDuration(repo.BranchAge(cname))
|
||||||
|
|
||||||
if repo.IsDirty() {
|
if repo.IsDirty() {
|
||||||
age = ""
|
age = ""
|
||||||
|
|
13
rill.go
13
rill.go
|
@ -1,6 +1,8 @@
|
||||||
package forgepb
|
package forgepb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
"github.com/destel/rill"
|
"github.com/destel/rill"
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
@ -65,7 +67,7 @@ func (f *Forge) updateRepo(repo *gitpb.Repo) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var RillX int = 30
|
var RillX int = 10
|
||||||
var RillY int = 10
|
var RillY int = 10
|
||||||
|
|
||||||
// x is the size of the queued up pool (shouldn't matter here for this I think)
|
// x is the size of the queued up pool (shouldn't matter here for this I think)
|
||||||
|
@ -125,6 +127,9 @@ func (f *Forge) RillFuncError(rillf func(*gitpb.Repo) error) int {
|
||||||
ids := rill.FromSlice(all, nil)
|
ids := rill.FromSlice(all, nil)
|
||||||
|
|
||||||
var counter int
|
var counter int
|
||||||
|
var watch int = 10
|
||||||
|
var meMu sync.Mutex
|
||||||
|
|
||||||
// Read users from the API.
|
// Read users from the API.
|
||||||
// Concurrency = 20
|
// Concurrency = 20
|
||||||
dirs := rill.Map(ids, RillX, func(id *gitpb.Repo) (*gitpb.Repo, error) {
|
dirs := rill.Map(ids, RillX, func(id *gitpb.Repo) (*gitpb.Repo, error) {
|
||||||
|
@ -132,7 +137,13 @@ func (f *Forge) RillFuncError(rillf func(*gitpb.Repo) error) int {
|
||||||
})
|
})
|
||||||
|
|
||||||
err := rill.ForEach(dirs, RillY, func(repo *gitpb.Repo) error {
|
err := rill.ForEach(dirs, RillY, func(repo *gitpb.Repo) error {
|
||||||
|
meMu.Lock()
|
||||||
counter += 1
|
counter += 1
|
||||||
|
if counter > watch {
|
||||||
|
// log.Info("Processed", watch, "repos") // this doesn't work
|
||||||
|
watch += 50
|
||||||
|
}
|
||||||
|
meMu.Unlock()
|
||||||
return rillf(repo)
|
return rillf(repo)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue