Skip to content

Commit

Permalink
more debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jdogmcsteezy committed Aug 23, 2024
1 parent aa2fa28 commit 73e8d87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions cmd/indexCreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,16 @@ asvec index create -i myindex -n test -s testset -d 256 -m COSINE --%s vector \
if !oneRequiredFlagsSet {
ioReader := os.Stdin
if indexCreateFlags.inputFile != StdIn {
logger.Info("reading input file")
r, err := os.Open(indexCreateFlags.inputFile)
if err != nil {
logger.Error("failed to open index definitions file", slog.Any("error", err))
return err
}

ioReader = r
} else {
logger.Debug("attempting to read index definitions from stdin")
}

if s, err := ioReader.Stat(); err == nil && s.Size() != 0 {
Expand Down Expand Up @@ -174,6 +178,8 @@ asvec index create -i myindex -n test -s testset -d 256 -m COSINE --%s vector \

logger.Debug("parsed index definitions from stdin", slog.Any("indexes", stdinIndexDefinitions))
configureRequiredFlags = false
} else {
logger.Debug("no data available to read from stdin")
}
}

Expand Down
4 changes: 2 additions & 2 deletions e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ func (suite *CmdTestSuite) TestPipeFromListIndexToCreateIndex() {
"s/exists/does-not-exist-yet/g",
false,
[]string{
"Successfully created index test.*.does-not-exist-yet",
"Successfully created index bar.barset.does-not-exist-yet",
"Successfully created index test.*.does-not-exist-yet1",
"Successfully created index bar.barset.does-not-exist-yet2",
"Successfully created all indexes from yaml",
},
},
Expand Down

0 comments on commit 73e8d87

Please sign in to comment.