summaryrefslogtreecommitdiff
path: root/scanRepoDir.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-20 13:21:03 -0500
committerJeff Carr <[email protected]>2025-10-20 13:21:03 -0500
commit69b5038c58e6a8487f22aeaf28eddec5c785c283 (patch)
tree72b9910c32a803d8c7f3bffc0f5d7175516d39b0 /scanRepoDir.go
parent2ecc340541f88d4c1cbe437efe79a6fcfdbf5499 (diff)
probably better. notsure
Diffstat (limited to 'scanRepoDir.go')
-rw-r--r--scanRepoDir.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/scanRepoDir.go b/scanRepoDir.go
index c138353..81149aa 100644
--- a/scanRepoDir.go
+++ b/scanRepoDir.go
@@ -1,11 +1,13 @@
package forgepb
import (
+ "errors"
"fmt"
"os"
"path/filepath"
"github.com/destel/rill"
+ "go.wit.com/lib/cobol"
"go.wit.com/lib/config"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
@@ -36,7 +38,7 @@ func (f *Forge) checkNamespace(fullpath string) (*gitpb.Repo, error) {
}
func (f *Forge) ScanRepoDir() error {
- dirs, err := gitDirectoriesNew(f.Config.ReposDir)
+ dirs, err := gitDirectoriesNew(config.Get("ReposDir"))
if err != nil {
return err
}
@@ -68,13 +70,13 @@ func (f *Forge) rillScanDirsNew(fullpaths []string) (int, error) {
ids := rill.FromSlice(fullpaths, nil)
// Read users from the API. // Concurrency = 20
- dirs := rill.Map(ids, int(f.Config.RillX), func(id string) (*gitpb.Repo, error) {
+ dirs := rill.Map(ids, cobol.Int(config.Get("RillX")), func(id string) (*gitpb.Repo, error) {
return f.checkNamespace(id)
})
var counter int
// Activate users. // Concurrency = 10
- err := rill.ForEach(dirs, int(f.Config.RillY), func(repo *gitpb.Repo) error {
+ err := rill.ForEach(dirs, cobol.Int(config.Get("RillY")), func(repo *gitpb.Repo) error {
if repo == nil {
return nil
}
@@ -94,6 +96,10 @@ func (f *Forge) rillScanDirsNew(fullpaths []string) (int, error) {
// doesn't enter the directory any further when it finds a .git/
// not stupid like my old version
func gitDirectoriesNew(srcDir string) ([]string, error) {
+ if srcDir == "" {
+ log.Info("SCANNING DISALBED")
+ return nil, errors.New("SCANNING DISALBED")
+ }
var all []string
var trip bool
err := filepath.WalkDir(srcDir, func(path string, d os.DirEntry, err error) error {