summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'init.go')
-rw-r--r--init.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/init.go b/init.go
index 8d3342f..bb98f40 100644
--- a/init.go
+++ b/init.go
@@ -40,18 +40,29 @@ func Init() *Forge {
f.Machine.InitWit()
+ 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 f
+ }
+ }
+
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)
}
- f.rillUpdate(20, 10)
-
if f.configSave {
// taking this out to debug Marshal() panic
// os.Exit(-1)
@@ -108,6 +119,9 @@ func (f *Forge) InitPB() {
}
f.Repos = gitpb.NewRepos()
f.Repos.ConfigLoad()
+ if f.Repos.HasFullScan {
+ f.hasFullScan = true
+ }
}
// only init's the protobuf. intended to not scan or change anything