Skip to content

Commit a76e4d0

Browse files
committed
fix: do not autoload local-store
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 111d3da commit a76e4d0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pkg/model/initializers.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,20 @@ func backendPath(assetDir, backend string) string {
4444
return filepath.Join(assetDir, "backend-assets", "grpc", backend)
4545
}
4646

47-
func bakends(assetDir string) ([]string, error) {
47+
func backendsInAssetDir(assetDir string) ([]string, error) {
48+
excludeBackends := []string{"local-store"}
4849
entry, err := os.ReadDir(backendPath(assetDir, ""))
4950
if err != nil {
5051
return nil, err
5152
}
5253
var backends []string
54+
ENTRY:
5355
for _, e := range entry {
56+
for _, exclude := range excludeBackends {
57+
if e.Name() == exclude {
58+
continue ENTRY
59+
}
60+
}
5461
if !e.IsDir() {
5562
backends = append(backends, e.Name())
5663
}
@@ -250,7 +257,7 @@ func (ml *ModelLoader) GreedyLoader(opts ...Option) (grpc.Backend, error) {
250257

251258
// autoload also external backends
252259
allBackendsToAutoLoad := []string{}
253-
autoLoadBackends, err := bakends(o.assetDir)
260+
autoLoadBackends, err := backendsInAssetDir(o.assetDir)
254261
if err != nil {
255262
return nil, err
256263
}

0 commit comments

Comments
 (0)