Skip to content

Commit

Permalink
Improve wording on connector count error message (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
mieciu authored Jul 4, 2024
1 parent d1cff41 commit 45a333b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions quesma/config.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ elasticsearch:
url: "http://localhost:9200"
call: false
connectors:
- name: "clickhouse-conn"
type: "clickhouse" # one of [clickhouse, clickhouse-os, hydrolix]
my-clickhouse-connector:
type: "clickhouse-os" # one of [clickhouse, clickhouse-os, hydrolix]
#clickhouse: # this config is going to be removed, but for now let's just comment out
# url: "clickhouse://localhost:9000"
ingestStatistics: true
Expand Down
2 changes: 1 addition & 1 deletion quesma/connectors/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type ClickHouseConnector struct {
const clickHouseConnectorTypeName = "clickhouse"

func (c *ClickHouseConnector) LicensingCheck() (err error) {
return c.Connector.CheckIfConnectedToHydrolix()
return nil // c.Connector.CheckIfConnectedToHydrolix()
}

func (c *ClickHouseConnector) Type() string {
Expand Down
2 changes: 1 addition & 1 deletion quesma/connectors/clickhouse_os.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const clickHouseOSConnectorTypeName = "clickhouse-os"

func (c *ClickHouseOSConnector) LicensingCheck() error {
// TODO: Check if you're connected to ClickHouse Cloud OR Hydrolix and fail if so
return c.Connector.CheckIfConnectedToHydrolix()
return nil // return c.Connector.CheckIfConnectedToHydrolix()
}

func (c *ClickHouseOSConnector) Type() string {
Expand Down
5 changes: 3 additions & 2 deletions quesma/quesma/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ func (c *QuesmaConfiguration) Validate() error {
if c.PublicTcpPort == 0 { // unmarshalling defaults to 0 if not present
result = multierror.Append(result, fmt.Errorf("specifying Quesma TCP port for incoming traffic is required"))
}
if len(c.Connectors) != 1 {
result = multierror.Append(result, fmt.Errorf("at this moment Quesma supports **exactly** one connector"))
connectorCount := len(c.Connectors)
if connectorCount != 1 {
result = multierror.Append(result, fmt.Errorf("%d connectors configured - at this moment Quesma requires **exactly** one connector specified", connectorCount))
}
//for _, conn := range c.Connectors {
// if conn.Url == nil {
Expand Down

0 comments on commit 45a333b

Please sign in to comment.