tangled
alpha
login
or
join now
angrydutchman.peedee.es
/
plcbundle
forked from
atscan.net/plcbundle
0
fork
atom
A Transparent and Verifiable Way to Sync the AT Protocol's PLC Directory
0
fork
atom
overview
issues
pulls
pipelines
faster
tree.fail
4 months ago
2d6952e7
7346582d
+12
-3
1 changed file
expand all
collapse all
unified
split
bundle
manager.go
+12
-3
bundle/manager.go
···
7
7
"log"
8
8
"os"
9
9
"path/filepath"
10
10
+
"runtime"
10
11
"sort"
11
12
"strconv"
12
13
"strings"
···
95
96
}
96
97
}
97
98
98
98
-
// Perform rebuild if needed
99
99
+
// Perform rebuild if needed (using parallel scan)
99
100
if needsRebuild {
100
101
config.Logger.Printf("Rebuilding index from %d bundle files...", len(bundleFiles))
101
102
···
108
109
logger: config.Logger,
109
110
}
110
111
111
111
-
// Scan directory to rebuild index
112
112
-
_, err := tempMgr.ScanDirectory()
112
112
+
// Use parallel scan with auto-detected CPU count
113
113
+
workers := runtime.NumCPU()
114
114
+
if workers < 1 {
115
115
+
workers = 1
116
116
+
}
117
117
+
118
118
+
config.Logger.Printf("Using %d workers for parallel scan", workers)
119
119
+
120
120
+
// Scan directory to rebuild index (parallel)
121
121
+
_, err := tempMgr.ScanDirectoryParallel(workers, nil)
113
122
if err != nil {
114
123
return nil, fmt.Errorf("failed to rebuild index: %w", err)
115
124
}