missing \n in Printf()
This commit is contained in:
parent
7e2caa9290
commit
f82c9ee088
53
rill.go
53
rill.go
|
@ -42,7 +42,7 @@ func (f *Forge) rillUpdate(pool1 int, pool2 int) (int, error) {
|
||||||
|
|
||||||
func (f *Forge) updateRepo(repo *gitpb.Repo) error {
|
func (f *Forge) updateRepo(repo *gitpb.Repo) error {
|
||||||
if !repo.IsValidDir() {
|
if !repo.IsValidDir() {
|
||||||
log.Printf("%10s %-50s gopath=%s\n", "git dir is missing:", repo.FullPath, repo.GetGoPath())
|
log.Printf("%10s %-50s gopath=%s\n", "git dir is missing\n", repo.FullPath, repo.GetGoPath())
|
||||||
f.Repos.DeleteByFullPath(repo.FullPath)
|
f.Repos.DeleteByFullPath(repo.FullPath)
|
||||||
f.configSave = true
|
f.configSave = true
|
||||||
return nil
|
return nil
|
||||||
|
@ -79,7 +79,7 @@ func (f *Forge) RillReload() int {
|
||||||
var all []*gitpb.Repo
|
var all []*gitpb.Repo
|
||||||
for repo := range f.Repos.IterAll() {
|
for repo := range f.Repos.IterAll() {
|
||||||
if !repo.IsValidDir() {
|
if !repo.IsValidDir() {
|
||||||
log.Printf("%s %-50s", "got an invalid repo in forgepb.RillReload()", repo.GetGoPath())
|
log.Printf("%s %-50s\n", "got an invalid repo in forgepb.RillReload()", repo.GetGoPath())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
all = append(all, repo)
|
all = append(all, repo)
|
||||||
|
@ -113,55 +113,6 @@ func (f *Forge) RillReload() int {
|
||||||
// todo: store x,y in forge config ? (or compute them. notsure)
|
// todo: store x,y in forge config ? (or compute them. notsure)
|
||||||
func (f *Forge) RillFuncError(rillf func(*gitpb.Repo) error) map[string]*RillStats {
|
func (f *Forge) RillFuncError(rillf func(*gitpb.Repo) error) map[string]*RillStats {
|
||||||
return f.RillRepos(rillf)
|
return f.RillRepos(rillf)
|
||||||
/*
|
|
||||||
var all []*gitpb.Repo
|
|
||||||
|
|
||||||
var stats map[string]*RillStats
|
|
||||||
stats = make(map[string]*RillStats)
|
|
||||||
|
|
||||||
for repo := range f.Repos.IterAll() {
|
|
||||||
if !repo.IsValidDir() {
|
|
||||||
log.Printf("%s %-50s", "got an invalid repo in forgepb.RillFuncError()", repo.GetGoPath())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
all = append(all, repo)
|
|
||||||
}
|
|
||||||
// Convert a slice of user IDs into a channel
|
|
||||||
ids := rill.FromSlice(all, nil)
|
|
||||||
|
|
||||||
var counter int
|
|
||||||
var watch int = 10
|
|
||||||
var meMu sync.Mutex
|
|
||||||
|
|
||||||
// Read users from the API.
|
|
||||||
// Concurrency = 20
|
|
||||||
dirs := rill.Map(ids, RillX, func(id *gitpb.Repo) (*gitpb.Repo, error) {
|
|
||||||
return id, nil
|
|
||||||
})
|
|
||||||
|
|
||||||
err := rill.ForEach(dirs, RillY, func(repo *gitpb.Repo) error {
|
|
||||||
meMu.Lock()
|
|
||||||
counter += 1
|
|
||||||
if counter > watch {
|
|
||||||
// log.Info("Processed", watch, "repos") // this doesn't work
|
|
||||||
watch += 50
|
|
||||||
}
|
|
||||||
meMu.Unlock()
|
|
||||||
rillSetStartTime(stats, repo.GetFullPath())
|
|
||||||
err := rillf(repo)
|
|
||||||
if err != nil {
|
|
||||||
rillSetError(stats, repo.GetFullPath(), err)
|
|
||||||
}
|
|
||||||
rillSetEndTime(stats, repo.GetFullPath())
|
|
||||||
return err
|
|
||||||
})
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Info("rill.ForEach() error:", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return stats
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Forge) ConfigRill(rillX int, rillY int) {
|
func (f *Forge) ConfigRill(rillX int, rillY int) {
|
||||||
|
|
Loading…
Reference in New Issue