Alexey Kim 1 год назад
Родитель
Сommit
5b5cc16279
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      database/config.go

+ 8 - 4
database/config.go

@@ -2,7 +2,6 @@ package database
 
 import (
 	"fmt"
-	"git.beejay.kim/Craft/Api/config"
 	"github.com/ClickHouse/clickhouse-go/v2"
 	"strings"
 )
@@ -12,7 +11,12 @@ type Config struct {
 }
 
 func (cfg Config) Invalidate() error {
-	return config.Invalidate(cfg)
+	var err error
+	if err = cfg.Clickhouse.Invalidate(); err != nil {
+		return err
+	}
+
+	return nil
 }
 
 type configCH struct {
@@ -49,7 +53,7 @@ func (c configCH) Invalidate() error {
 		return fmt.Errorf("`clickhouse.database` must not be an empty string")
 	}
 
-	return config.Invalidate(c)
+	return c.Params.Invalidate()
 }
 
 func (p params) Invalidate() error {
@@ -73,7 +77,7 @@ func (p params) Invalidate() error {
 		return fmt.Errorf("`clickhouse.params.write-timeout` must not be at least 1")
 	}
 
-	return config.Invalidate(p)
+	return nil
 }
 
 func (p params) CompressionMethod() clickhouse.CompressionMethod {