Skip to content

Commit

Permalink
Fix Dashboard UI Hydrolix's connection problem (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
mieciu authored May 14, 2024
1 parent 64b700a commit e77ab7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions quesma/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,10 @@ func (lm *LogManager) AddTableIfDoesntExist(table *Table) bool {
return wasntCreated
}

func (lm *LogManager) Ping() error {
return lm.chDb.Ping()
}

func NewEmptyLogManager(cfg config.QuesmaConfiguration, chDb *sql.DB, phoneHomeAgent telemetry.PhoneHomeAgent) *LogManager {
ctx, cancel := context.WithCancel(context.Background())
var schemaManagement = NewSchemaManagement(chDb)
Expand Down
5 changes: 1 addition & 4 deletions quesma/quesma/ui/dashboard_healthcheck.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ui

import (
"github.com/ClickHouse/clickhouse-go/v2"
"net/http"
"sync"
"time"
Expand Down Expand Up @@ -55,9 +54,7 @@ func (qmc *QuesmaManagementConsole) checkClickhouseHealth() healthCheckStatus {
}

return qmc.clickhouseStatusCache.check(func() healthCheckStatus {
chDb := clickhouse.OpenDB(&clickhouse.Options{Addr: []string{qmc.config.ClickHouse.Url.Host}})
defer chDb.Close()
err := chDb.Ping()
err := qmc.logManager.Ping()
if err != nil {
return healthCheckStatus{"red", "Ping failed", err.Error()}

Expand Down

0 comments on commit e77ab7d

Please sign in to comment.