diff options
| -rw-r--r-- | rill.go | 62 | ||||
| -rw-r--r-- | tableDefault.go | 2 | ||||
| -rw-r--r-- | tableForged.go | 2 | ||||
| -rw-r--r-- | tablePull.go | 6 |
4 files changed, 10 insertions, 62 deletions
@@ -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 { diff --git a/tableDefault.go b/tableDefault.go index 823fa98..49c16c2 100644 --- a/tableDefault.go +++ b/tableDefault.go @@ -5,6 +5,7 @@ package forgepb import ( "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/gitpb" + "go.wit.com/log" ) // this is the default table layout for repos in forge @@ -12,6 +13,7 @@ import ( func (f *Forge) PrintDefaultTB(pb *gitpb.Repos) { tablePB := f.makeDefaultTB(pb) tablePB.PrintTable() + log.Printf("fpb.PrintDefaultTB: %d repos\n", pb.Len()) } func (f *Forge) getRepoType(repo *gitpb.Repo) string { diff --git a/tableForged.go b/tableForged.go index 19d0818..eef7d81 100644 --- a/tableForged.go +++ b/tableForged.go @@ -4,11 +4,13 @@ package forgepb import ( "go.wit.com/lib/protobuf/gitpb" + "go.wit.com/log" ) func (f *Forge) PrintForgedTable(pb *gitpb.Repos) { tablePB := f.makeForgedTable(pb) tablePB.PrintTable() + log.Printf("fpb.ForgedTable: %d repos\n", pb.Len()) } func (f *Forge) makeForgedTable(pb *gitpb.Repos) *gitpb.ReposTable { diff --git a/tablePull.go b/tablePull.go index 8e0a282..2e87e40 100644 --- a/tablePull.go +++ b/tablePull.go @@ -6,11 +6,13 @@ import ( "path/filepath" "go.wit.com/lib/protobuf/gitpb" + "go.wit.com/log" ) -func (f *Forge) PrintPullTable(all *gitpb.Repos) { - tablePB := f.makePullTable(all) +func (f *Forge) PrintPullTable(pb *gitpb.Repos) { + tablePB := f.makePullTable(pb) tablePB.PrintTable() + log.Printf("fpb.PullTable: %d repos\n", pb.Len()) } func (f *Forge) makePullTable(pb *gitpb.Repos) *gitpb.ReposTable { |
