summaryrefslogtreecommitdiff
path: root/rill.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-20 13:21:03 -0500
committerJeff Carr <[email protected]>2025-10-20 13:21:03 -0500
commit69b5038c58e6a8487f22aeaf28eddec5c785c283 (patch)
tree72b9910c32a803d8c7f3bffc0f5d7175516d39b0 /rill.go
parent2ecc340541f88d4c1cbe437efe79a6fcfdbf5499 (diff)
probably better. notsure
Diffstat (limited to 'rill.go')
-rw-r--r--rill.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/rill.go b/rill.go
index 20d85ed..013c79f 100644
--- a/rill.go
+++ b/rill.go
@@ -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