rm full scan stuff
This commit is contained in:
parent
ef00352a0b
commit
6c3162f7ce
37
init.go
37
init.go
|
@ -47,40 +47,6 @@ func InitByAppname(argname string) *Forge {
|
|||
return f
|
||||
}
|
||||
|
||||
/*
|
||||
func (f *Forge) InitScan() {
|
||||
if f.hasFullScan {
|
||||
// duplicate time checking below. which one to keep?
|
||||
if f.FullScanAge() > time.Minute {
|
||||
log.Log(INFO, "forgepb.Scan() skipping scan. been run a minute ago", f.FullScanAge())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
start := f.Repos.Len()
|
||||
f.ScanGoSrc()
|
||||
f.FullScanRan()
|
||||
end := f.Repos.Len()
|
||||
if (end - start) == 0 {
|
||||
log.Log(INFO, "forgepb.Scan() Scan did not find new git repositories. Total =", end)
|
||||
if f.FullScanAge() > time.Minute {
|
||||
f.rillUpdate(20, 10)
|
||||
}
|
||||
} else {
|
||||
log.Log(INFO, "forgepb.Scan() Scan found", end-start, "new git repositories. Total =", end)
|
||||
f.rillUpdate(20, 10)
|
||||
}
|
||||
|
||||
if f.configSave {
|
||||
// taking this out to debug Marshal() panic
|
||||
f.ConfigSave()
|
||||
f.configSave = false
|
||||
}
|
||||
log.Log(INFO, "update() check took", shell.FormatDuration(time.Since(now)))
|
||||
}
|
||||
*/
|
||||
|
||||
func initFromConfig(cfg *ForgeConfigs) *Forge {
|
||||
f := new(Forge)
|
||||
f.Config = cfg
|
||||
|
@ -91,9 +57,6 @@ func initFromConfig(cfg *ForgeConfigs) *Forge {
|
|||
|
||||
f.Repos = gitpb.NewRepos()
|
||||
f.Repos.ConfigLoad()
|
||||
if f.Repos.HasFullScan {
|
||||
f.hasFullScan = true
|
||||
}
|
||||
|
||||
// init the Patchsets
|
||||
f.Patchsets = NewPatchsets()
|
||||
|
|
|
@ -87,12 +87,10 @@ func (pb *Patchset) ShowPatchsets() error {
|
|||
comment := cleanSubject(patch.Comment)
|
||||
log.Printf("\t%-8s %-50s %-50s\n", string(patch.CommitHash)[0:8], patch.Namespace, comment)
|
||||
}
|
||||
/*
|
||||
for patch := range pb.IterAll() {
|
||||
comment := cleanSubject(patch.Comment)
|
||||
log.Info("\tnew patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.Namespace, comment)
|
||||
}
|
||||
*/
|
||||
// for patch := range pb.IterAll() {
|
||||
// comment := cleanSubject(patch.Comment)
|
||||
// log.Info("\tnew patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.Namespace, comment)
|
||||
// }
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
18
structs.go
18
structs.go
|
@ -2,7 +2,6 @@ package forgepb
|
|||
|
||||
import (
|
||||
sync "sync"
|
||||
"time"
|
||||
|
||||
"go.wit.com/lib/protobuf/gitpb"
|
||||
)
|
||||
|
@ -16,8 +15,6 @@ type Forge struct {
|
|||
Config *ForgeConfigs // config repos for readonly, private, etc
|
||||
Repos *gitpb.Repos // the repo protobufs
|
||||
configSave bool // if you need to save the config because things changed
|
||||
hasFullScan bool // track last scan so it can be throttled
|
||||
fullscan time.Time // time of the last scan so it can be throttled
|
||||
hostname string // your hostname
|
||||
rillX int // used for Rill()
|
||||
rillY int // used for Rill()
|
||||
|
@ -35,18 +32,3 @@ func (f *Forge) GetGoSrc() string {
|
|||
func (f *Forge) IsGoWork() bool {
|
||||
return f.goWork
|
||||
}
|
||||
|
||||
/*
|
||||
func (f *Forge) HasFullScan() bool {
|
||||
return f.Repos.HasFullScan
|
||||
}
|
||||
|
||||
func (f *Forge) FullScanRan() {
|
||||
f.fullscan = time.Now()
|
||||
}
|
||||
|
||||
func (f *Forge) FullScanAge() time.Duration {
|
||||
fs := f.Repos.FullScan.AsTime()
|
||||
return time.Since(fs)
|
||||
}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue