From 58c64cd53b46f0b9e1e23f1bf10cc055e85025c1 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 19 Jan 2025 10:48:50 -0600 Subject: might show branch age in table finally --- humanTable.go | 2 +- rill.go | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/humanTable.go b/humanTable.go index 8462323..0228a92 100644 --- a/humanTable.go +++ b/humanTable.go @@ -179,7 +179,7 @@ func (f *Forge) printRepoToTable(repo *gitpb.Repo) { // ctime := repo.Tags.GetAge(mhort) // age := shell.FormatDuration(time.Since(ctime)) - age := shell.FormatDuration(repo.NewestAge()) + age := shell.FormatDuration(repo.BranchAge(cname)) if repo.IsDirty() { age = "" diff --git a/rill.go b/rill.go index b07128f..24829e2 100644 --- a/rill.go +++ b/rill.go @@ -1,6 +1,8 @@ package forgepb import ( + "sync" + "github.com/destel/rill" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" @@ -65,7 +67,7 @@ func (f *Forge) updateRepo(repo *gitpb.Repo) error { return nil } -var RillX int = 30 +var RillX int = 10 var RillY int = 10 // 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) var counter int + var watch int = 10 + var meMu sync.Mutex + // Read users from the API. // Concurrency = 20 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 { + meMu.Lock() counter += 1 + if counter > watch { + // log.Info("Processed", watch, "repos") // this doesn't work + watch += 50 + } + meMu.Unlock() return rillf(repo) }) -- cgit v1.2.3