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
|
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 {
|
func initFromConfig(cfg *ForgeConfigs) *Forge {
|
||||||
f := new(Forge)
|
f := new(Forge)
|
||||||
f.Config = cfg
|
f.Config = cfg
|
||||||
|
@ -91,9 +57,6 @@ func initFromConfig(cfg *ForgeConfigs) *Forge {
|
||||||
|
|
||||||
f.Repos = gitpb.NewRepos()
|
f.Repos = gitpb.NewRepos()
|
||||||
f.Repos.ConfigLoad()
|
f.Repos.ConfigLoad()
|
||||||
if f.Repos.HasFullScan {
|
|
||||||
f.hasFullScan = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// init the Patchsets
|
// init the Patchsets
|
||||||
f.Patchsets = NewPatchsets()
|
f.Patchsets = NewPatchsets()
|
||||||
|
|
|
@ -87,12 +87,10 @@ func (pb *Patchset) ShowPatchsets() error {
|
||||||
comment := cleanSubject(patch.Comment)
|
comment := cleanSubject(patch.Comment)
|
||||||
log.Printf("\t%-8s %-50s %-50s\n", string(patch.CommitHash)[0:8], patch.Namespace, comment)
|
log.Printf("\t%-8s %-50s %-50s\n", string(patch.CommitHash)[0:8], patch.Namespace, comment)
|
||||||
}
|
}
|
||||||
/*
|
// for patch := range pb.IterAll() {
|
||||||
for patch := range pb.IterAll() {
|
// comment := cleanSubject(patch.Comment)
|
||||||
comment := cleanSubject(patch.Comment)
|
// log.Info("\tnew patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.Namespace, comment)
|
||||||
log.Info("\tnew patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.Namespace, comment)
|
// }
|
||||||
}
|
|
||||||
*/
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
40
structs.go
40
structs.go
|
@ -2,7 +2,6 @@ package forgepb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
sync "sync"
|
sync "sync"
|
||||||
"time"
|
|
||||||
|
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
)
|
)
|
||||||
|
@ -10,19 +9,17 @@ import (
|
||||||
// maybe an interface someday?
|
// maybe an interface someday?
|
||||||
type Forge struct {
|
type Forge struct {
|
||||||
// one-time initialized data
|
// one-time initialized data
|
||||||
once sync.Once
|
once sync.Once
|
||||||
initErr error // init error, if any
|
initErr error // init error, if any
|
||||||
goWork bool // means the user is currently using a go.work file
|
goWork bool // means the user is currently using a go.work file
|
||||||
Config *ForgeConfigs // config repos for readonly, private, etc
|
Config *ForgeConfigs // config repos for readonly, private, etc
|
||||||
Repos *gitpb.Repos // the repo protobufs
|
Repos *gitpb.Repos // the repo protobufs
|
||||||
configSave bool // if you need to save the config because things changed
|
configSave bool // if you need to save the config because things changed
|
||||||
hasFullScan bool // track last scan so it can be throttled
|
hostname string // your hostname
|
||||||
fullscan time.Time // time of the last scan so it can be throttled
|
rillX int // used for Rill()
|
||||||
hostname string // your hostname
|
rillY int // used for Rill()
|
||||||
rillX int // used for Rill()
|
Patchsets *Patchsets // patches that are in progress
|
||||||
rillY int // used for Rill()
|
goSrc string // the path to go/src
|
||||||
Patchsets *Patchsets // patches that are in progress
|
|
||||||
goSrc string // the path to go/src
|
|
||||||
// forgeURL string // URL to use to forge.wit.com
|
// forgeURL string // URL to use to forge.wit.com
|
||||||
// configDir string // normally ~/.config/forge
|
// configDir string // normally ~/.config/forge
|
||||||
// patchDir string // where patches are stored
|
// patchDir string // where patches are stored
|
||||||
|
@ -35,18 +32,3 @@ func (f *Forge) GetGoSrc() string {
|
||||||
func (f *Forge) IsGoWork() bool {
|
func (f *Forge) IsGoWork() bool {
|
||||||
return f.goWork
|
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