Skip to content

Commit

Permalink
Fixed the log.fatal to error
Browse files Browse the repository at this point in the history
Signed-off-by: naveensrinivasan <[email protected]>
  • Loading branch information
naveensrinivasan committed Dec 3, 2024
1 parent 77a4fa4 commit c8f8522
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type options struct {
StoragePath string
UseInMemory bool
CORS []string
UseOpenAILLM bool
VectorDBPath string
UseOpenAILLM bool
VectorDBPath string
}

const (
Expand Down Expand Up @@ -145,12 +145,12 @@ func (o *options) startServer(server *http.Server) error {
if o.UseOpenAILLM {
db, err := chromadb.NewPersistentDB(o.VectorDBPath, false)
if err != nil {
log.Fatal("failed to initialize ChromaDB:", err)
return fmt.Errorf("failed to initialize ChromaDB: %w", err)
}

c, err := db.CreateCollection("knowledge-base", nil, nil)
if err != nil {
log.Fatal("failed to create collection in ChromaDB:", err)
return fmt.Errorf("failed to create collection in ChromaDB: %w", err)
}

// Initialize ChromaDB documents
Expand Down Expand Up @@ -229,7 +229,7 @@ func (o *options) startServer(server *http.Server) error {
},
}, runtime.NumCPU())
if err != nil {
log.Fatal("failed to add documents to ChromaDB:", err)
return fmt.Errorf("failed to add documents to ChromaDB: %w", err)
}
}

Expand Down

0 comments on commit c8f8522

Please sign in to comment.