diff options
Diffstat (limited to 'rill.go')
| -rw-r--r-- | rill.go | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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) }) |
