skipping n addons option

master
cheetah 1 year ago
parent c5b6c3c12e
commit 2efe33a1da

@ -123,7 +123,7 @@ func main() {
workerModeP := flag.String("mode", "", "mode (ingress, rebuild)")
debugEnabled := flag.Bool("debug", false, "enables debug")
folderPathP := flag.String("path", "/mnt/SC9000/TemporaryTestingShit2", "a string")
skipNameP := flag.String("skip", "", "skip until this name")
skipNameP := flag.Int("skip", -1, "skip n addons")
workerNameP := flag.String("worker", "def", "worker name")
rebuildIDP := flag.String("id", "", "id to rebuild")
@ -285,8 +285,8 @@ func recursive(jobs []string, folderPath string) (WorkerJobPool []string) {
return jobs
}
func modeIngress(folderPath string, skipName string) {
skipNameEnabled := len(skipName) > 0
func modeIngress(folderPath string, skipN int) {
// skipNameEnabled := skipN > 0
entries, err := os.ReadDir(folderPath)
if err != nil {
panic(err)
@ -298,17 +298,13 @@ func modeIngress(folderPath string, skipName string) {
if e.IsDir() {
WorkerJobPool = recursive(WorkerJobPool, fullPath)
}
if !e.IsDir() && skipNameEnabled {
if e.Name() == skipName {
skipNameEnabled = false
} else {
continue
}
}
if !e.IsDir() {
WorkerJobPool = append(WorkerJobPool, filepath.Join(folderPath, e.Name()))
}
}
if skipN > 0 {
WorkerJobPool = WorkerJobPool[skipN:]
}
wg := sync.WaitGroup{}
pw := progress.NewWriter()
@ -560,6 +556,9 @@ func ProcessGMA(pw progress.Writer, filePath string) (err error) {
dboGMA2Files = append(dboGMA2Files, dboGMA2File)
trackerProcess.Increment(1)
}
if len(files) < 1 {
return fmt.Errorf("GMA empty, len=%d", len(files))
}
lastFile := files[len(files)-1]
dboGMA.FooterAddonCRC, err = gmaReader.ReadAddonCRC(lastFile.Offset + lastFile.FileSize)

Loading…
Cancel
Save