diff options
Diffstat (limited to 'rill.go')
| -rw-r--r-- | rill.go | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1,10 +1,12 @@ package forgepb import ( + "fmt" "sync" "time" "github.com/destel/rill" + "go.wit.com/lib/cobol" "go.wit.com/lib/config" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" @@ -34,11 +36,11 @@ func (f *Forge) RillReload() int { var counter int // Read users from the API. // Concurrency = 20 - dirs := rill.Map(ids, int(f.Config.RillX), func(repo *gitpb.Repo) (*gitpb.Repo, error) { + dirs := rill.Map(ids, cobol.Int(config.Get("RillX")), func(repo *gitpb.Repo) (*gitpb.Repo, error) { return repo, nil }) - rill.ForEach(dirs, int(f.Config.RillY), func(repo *gitpb.Repo) error { + rill.ForEach(dirs, cobol.Int(config.Get("RillY")), func(repo *gitpb.Repo) error { if err := repo.HasChanged(); err != nil { counter += 1 return err @@ -58,8 +60,8 @@ func (f *Forge) RillFuncError(rillf func(*gitpb.Repo) error) map[string]*RillSta } func (f *Forge) ConfigRill(rillX int, rillY int) { - f.Config.RillX = int32(rillX) - f.Config.RillY = int32(rillY) + config.Set("RillX", fmt.Sprintf("%d", rillX)) + config.Set("RillY", fmt.Sprintf("%d", rillY)) // log.Infof("Setting rill values to %d,%d\n", f.Config.RillX, f.Config.RillY) } @@ -134,11 +136,11 @@ func (f *Forge) RillRepos(rillf func(*gitpb.Repo) error) map[string]*RillStats { // Read users from the API. // Concurrency = 20 - dirs := rill.Map(ids, int(f.Config.RillX), func(id *gitpb.Repo) (*gitpb.Repo, error) { + dirs := rill.Map(ids, cobol.Int(config.Get("RillX")), func(id *gitpb.Repo) (*gitpb.Repo, error) { return id, nil }) - rill.ForEach(dirs, int(f.Config.RillY), func(repo *gitpb.Repo) error { + rill.ForEach(dirs, cobol.Int(config.Get("RillY")), func(repo *gitpb.Repo) error { // todo: make this a goroutine to show stats to the user rillMu.Lock() counter += 1 @@ -185,11 +187,11 @@ func (f *Forge) RunOnRepos(repos *gitpb.Repos, rillf func(*gitpb.Repo) error) ma // Read users from the API. // Concurrency = 20 - dirs := rill.Map(ids, int(f.Config.RillX), func(id *gitpb.Repo) (*gitpb.Repo, error) { + dirs := rill.Map(ids, cobol.Int(config.Get("RillX")), func(id *gitpb.Repo) (*gitpb.Repo, error) { return id, nil }) - rill.ForEach(dirs, int(f.Config.RillY), func(repo *gitpb.Repo) error { + rill.ForEach(dirs, cobol.Int(config.Get("RillY")), func(repo *gitpb.Repo) error { // todo: make this a goroutine to show stats to the user rillMu.Lock() counter += 1 |
