Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ func main() {
} else {
// Redirect all standard logging to the file
log.SetOutput(logFile)
defer func() {
if closeErr := logFile.Close(); closeErr != nil {
fmt.Fprintf(os.Stderr, "Failed to close log file: %v\n", closeErr)
}
}()
}

// Critical: Use ServeStdio WITHOUT any console output to stdout
Expand Down
3 changes: 2 additions & 1 deletion pkg/dbtools/dbtools.go
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,8 @@ func getBasicSchemaInfo(ctx context.Context, db db.Database, dbID, dbType string

rows, err := db.Query(ctx, query)
if err != nil {
// Return empty schema if query fails
// Log the error but return empty schema to avoid breaking the tool
logger.Warn("Failed to get basic schema for database %s: %v", dbID, err)
return result
}
defer func() {
Expand Down
Loading