diff options
Diffstat (limited to 'rill.go')
| -rw-r--r-- | rill.go | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -6,6 +6,7 @@ import ( "time" "github.com/destel/rill" + "go.wit.com/lib/ENV" "go.wit.com/lib/cobol" "go.wit.com/lib/config" "go.wit.com/lib/protobuf/gitpb" @@ -36,11 +37,11 @@ func (f *Forge) RillReload() int { var counter int // Read users from the API. // Concurrency = 20 - dirs := rill.Map(ids, cobol.Int(config.Get("RillX")), func(repo *gitpb.Repo) (*gitpb.Repo, error) { + dirs := rill.Map(ids, cobol.Int(ENV.Get("RillX")), func(repo *gitpb.Repo) (*gitpb.Repo, error) { return repo, nil }) - rill.ForEach(dirs, cobol.Int(config.Get("RillY")), func(repo *gitpb.Repo) error { + rill.ForEach(dirs, cobol.Int(ENV.Get("RillY")), func(repo *gitpb.Repo) error { if err := repo.HasChanged(); err != nil { counter += 1 return err @@ -60,8 +61,8 @@ func (f *Forge) RillFuncError(rillf func(*gitpb.Repo) error) map[string]*RillSta } func (f *Forge) ConfigRill(rillX int, rillY int) { - config.Set("RillX", fmt.Sprintf("%d", rillX)) - config.Set("RillY", fmt.Sprintf("%d", rillY)) + ENV.Set("RillX", fmt.Sprintf("%d", rillX)) + ENV.Set("RillY", fmt.Sprintf("%d", rillY)) // log.Infof("Setting rill values to %d,%d\n", f.Config.RillX, f.Config.RillY) } @@ -136,11 +137,11 @@ func (f *Forge) RillRepos(rillf func(*gitpb.Repo) error) map[string]*RillStats { // Read users from the API. // Concurrency = 20 - dirs := rill.Map(ids, cobol.Int(config.Get("RillX")), func(id *gitpb.Repo) (*gitpb.Repo, error) { + dirs := rill.Map(ids, cobol.Int(ENV.Get("RillX")), func(id *gitpb.Repo) (*gitpb.Repo, error) { return id, nil }) - rill.ForEach(dirs, cobol.Int(config.Get("RillY")), func(repo *gitpb.Repo) error { + rill.ForEach(dirs, cobol.Int(ENV.Get("RillY")), func(repo *gitpb.Repo) error { // todo: make this a goroutine to show stats to the user rillMu.Lock() counter += 1 @@ -187,11 +188,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, cobol.Int(config.Get("RillX")), func(id *gitpb.Repo) (*gitpb.Repo, error) { + dirs := rill.Map(ids, cobol.Int(ENV.Get("RillX")), func(id *gitpb.Repo) (*gitpb.Repo, error) { return id, nil }) - rill.ForEach(dirs, cobol.Int(config.Get("RillY")), func(repo *gitpb.Repo) error { + rill.ForEach(dirs, cobol.Int(ENV.Get("RillY")), func(repo *gitpb.Repo) error { // todo: make this a goroutine to show stats to the user rillMu.Lock() counter += 1 |
