From 6c3162f7ce42a85afcff0b984fe6972f96fd3c8a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 11 Sep 2025 21:47:19 -0500 Subject: [PATCH] rm full scan stuff --- init.go | 37 ------------------------------------- patchset.config.go | 10 ++++------ structs.go | 40 +++++++++++----------------------------- 3 files changed, 15 insertions(+), 72 deletions(-) diff --git a/init.go b/init.go index ca5db21..fbb6210 100644 --- a/init.go +++ b/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() diff --git a/patchset.config.go b/patchset.config.go index 06a59da..a156521 100644 --- a/patchset.config.go +++ b/patchset.config.go @@ -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 } diff --git a/structs.go b/structs.go index 3c636d9..76aa7c7 100644 --- a/structs.go +++ b/structs.go @@ -2,7 +2,6 @@ package forgepb import ( sync "sync" - "time" "go.wit.com/lib/protobuf/gitpb" ) @@ -10,19 +9,17 @@ import ( // maybe an interface someday? type Forge struct { // one-time initialized data - once sync.Once - initErr error // init error, if any - goWork bool // means the user is currently using a go.work file - 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() - Patchsets *Patchsets // patches that are in progress - goSrc string // the path to go/src + once sync.Once + initErr error // init error, if any + goWork bool // means the user is currently using a go.work file + 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 + hostname string // your hostname + rillX int // used for Rill() + rillY int // used for Rill() + Patchsets *Patchsets // patches that are in progress + goSrc string // the path to go/src // forgeURL string // URL to use to forge.wit.com // configDir string // normally ~/.config/forge // patchDir string // where patches are stored @@ -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) -} -*/