summaryrefslogtreecommitdiff
path: root/rill.go
diff options
context:
space:
mode:
Diffstat (limited to 'rill.go')
-rw-r--r--rill.go62
1 files changed, 2 insertions, 60 deletions
diff --git a/rill.go b/rill.go
index 3488146..20d85ed 100644
--- a/rill.go
+++ b/rill.go
@@ -10,66 +10,8 @@ import (
"go.wit.com/log"
)
-/*
// rill is awesome. long live rill
-// attempt scan with rill
-func (f *Forge) rillUpdate(pool1 int, pool2 int) (int, error) {
- var repos []*gitpb.Repo
- all := f.Repos.SortByFullPath()
- for all.Scan() {
- repo := all.Next()
- repos = append(repos, repo)
- }
-
- // Convert a slice of user IDs into a channel
- ids := rill.FromSlice(repos, nil)
-
- // Read users from the API.
- // Concurrency = 20
- rills := rill.Map(ids, pool1, func(repo *gitpb.Repo) (*gitpb.Repo, error) {
- return repo, nil
- })
-
- var counter int
- // Activate users.
- // Concurrency = 10
- err := rill.ForEach(rills, pool2, func(repo *gitpb.Repo) error {
- counter += 1
- return f.updateRepo(repo)
- })
-
- return counter, err
-}
-*/
-
-/*
-func (f *Forge) updateRepo(repo *gitpb.Repo) error {
- if !repo.IsValidDir() {
- log.Printf("%10s %-50s gopath=%s\n", "git dir is missing\n", repo.FullPath, repo.GetNamespace())
- f.Repos.DeleteByFullPath(repo.FullPath)
- return nil
- }
-
- if err := repo.HasChanged(); err != nil {
- // something changed in the repo
- return err
- }
-
- // log.Info("repo did not change", repo.FullPath, repo.StateChange)
- if f.Config.IsReadOnly(repo.GetGoPath()) {
- if repo.ReadOnly {
- } else {
- log.Info("readonly flag on repo is wrong", repo.GetGoPath())
- repo.ReadOnly = true
- }
- }
- return nil
-}
-*/
-
-// var RillX int = 10
-// var RillY int = 20
-
+//
// x is the size of the queued up pool (shouldn't matter here for this I think)
// y is how many simultanous functions will run
// todo: tune and compute x,y by # of CPUs and disk io
@@ -118,7 +60,7 @@ 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)
- log.Infof("Setting rill values to %d,%d\n", f.Config.RillX, f.Config.RillY)
+ // log.Infof("Setting rill values to %d,%d\n", f.Config.RillX, f.Config.RillY)
}
type RillStats struct {