summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-19 10:48:50 -0600
committerJeff Carr <[email protected]>2025-01-19 10:48:50 -0600
commit58c64cd53b46f0b9e1e23f1bf10cc055e85025c1 (patch)
tree9096de67ce42d6d4df47b6295d96a7151e86b425
parentf29f25b9b7ddf0ebf869ba764df844f87fce063f (diff)
might show branch age in table finally
-rw-r--r--humanTable.go2
-rw-r--r--rill.go13
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)
})