diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0ea2913..7d50d14 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,8 +12,6 @@ on: required: true type: string -env: - SCCACHE_GHA_ENABLED: "true" jobs: build: @@ -44,8 +42,6 @@ jobs: cd TDengine echo "commit_id=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.3 - name: Cache server by pr if: github.event_name == 'pull_request' @@ -77,7 +73,7 @@ jobs: cd TDengine mkdir debug cd debug - cmake .. -DBUILD_TEST=off -DBUILD_HTTP=false -DVERNUMBER=3.9.9.9 -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache + cmake .. -DBUILD_TEST=off -DBUILD_HTTP=false -DVERNUMBER=3.9.9.9 make -j 4 - name: package diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 64f795c..134ca7f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -6,8 +6,6 @@ on: - 'main' - '3.0' -env: - SCCACHE_GHA_ENABLED: "true" jobs: build: @@ -29,8 +27,6 @@ jobs: cd TDengine echo "commit_id=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.3 - name: Cache server id: cache-server @@ -43,8 +39,6 @@ jobs: if: steps.cache-server.outputs.cache-hit != 'true' run: sudo apt install -y libgeos-dev - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.3 - name: install TDengine if: steps.cache-server.outputs.cache-hit != 'true' @@ -52,7 +46,7 @@ jobs: cd TDengine mkdir debug cd debug - cmake .. -DBUILD_JDBC=false -DBUILD_TEST=off -DBUILD_HTTP=false -DVERNUMBER=3.9.9.9 -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache + cmake .. -DBUILD_JDBC=false -DBUILD_TEST=off -DBUILD_HTTP=false -DVERNUMBER=3.9.9.9 make -j 4 - name: package diff --git a/examples/stmtoverws/main.go b/examples/stmtoverws/main.go index a9c0d5a..6e083df 100644 --- a/examples/stmtoverws/main.go +++ b/examples/stmtoverws/main.go @@ -19,7 +19,7 @@ func main() { defer db.Close() prepareEnv(db) - config := stmt.NewConfig("ws://127.0.0.1:6041/rest/stmt", 0) + config := stmt.NewConfig("ws://127.0.0.1:6041", 0) config.SetConnectUser("root") config.SetConnectPass("taosdata") config.SetConnectDB("example_ws_stmt") diff --git a/examples/tmqoverws/main.go b/examples/tmqoverws/main.go index b0fdf91..cac691a 100644 --- a/examples/tmqoverws/main.go +++ b/examples/tmqoverws/main.go @@ -18,7 +18,7 @@ func main() { defer db.Close() prepareEnv(db) consumer, err := tmq.NewConsumer(&tmqcommon.ConfigMap{ - "ws.url": "ws://127.0.0.1:6041/rest/tmq", + "ws.url": "ws://127.0.0.1:6041", "ws.message.channelLen": uint(0), "ws.message.timeout": common.DefaultMessageTimeout, "ws.message.writeWait": common.DefaultWriteWait, diff --git a/ws/schemaless/schemaless.go b/ws/schemaless/schemaless.go index c6dcf6b..5494745 100644 --- a/ws/schemaless/schemaless.go +++ b/ws/schemaless/schemaless.go @@ -44,9 +44,7 @@ func NewSchemaless(config *Config) (*Schemaless, error) { if wsUrl.Scheme != "ws" && wsUrl.Scheme != "wss" { return nil, errors.New("config url scheme error") } - if len(wsUrl.Path) == 0 || wsUrl.Path != "/rest/schemaless" { - wsUrl.Path = "/rest/schemaless" - } + wsUrl.Path = "/ws" dialer := common.DefaultDialer dialer.EnableCompression = config.enableCompression ws, _, err := dialer.Dial(wsUrl.String(), nil) diff --git a/ws/schemaless/schemaless_test.go b/ws/schemaless/schemaless_test.go index 14dbb0d..d3754e2 100644 --- a/ws/schemaless/schemaless_test.go +++ b/ws/schemaless/schemaless_test.go @@ -62,7 +62,7 @@ func TestSchemaless_Insert(t *testing.T) { } defer func() { _ = after() }() - s, err := NewSchemaless(NewConfig("ws://localhost:6041/rest/schemaless", 1, + s, err := NewSchemaless(NewConfig("ws://localhost:6041", 1, SetDb("test_schemaless_ws"), SetReadTimeout(10*time.Second), SetWriteTimeout(10*time.Second), diff --git a/ws/stmt/connector.go b/ws/stmt/connector.go index 48830c2..c33e57b 100644 --- a/ws/stmt/connector.go +++ b/ws/stmt/connector.go @@ -5,6 +5,7 @@ import ( "context" "errors" "fmt" + "net/url" "sync" "sync/atomic" "time" @@ -46,7 +47,12 @@ func NewConnector(config *Config) (*Connector, error) { } dialer := common.DefaultDialer dialer.EnableCompression = config.EnableCompression - ws, _, err := dialer.Dial(config.Url, nil) + u, err := url.Parse(config.Url) + if err != nil { + return nil, err + } + u.Path = "/ws" + ws, _, err := dialer.Dial(u.String(), nil) if err != nil { return nil, err } diff --git a/ws/stmt/stmt_test.go b/ws/stmt/stmt_test.go index f8f8f82..d0ffc69 100644 --- a/ws/stmt/stmt_test.go +++ b/ws/stmt/stmt_test.go @@ -158,7 +158,7 @@ func TestStmt(t *testing.T) { } defer cleanEnv() now := time.Now() - config := NewConfig("ws://127.0.0.1:6041/rest/stmt", 0) + config := NewConfig("ws://127.0.0.1:6041", 0) config.SetConnectUser("root") config.SetConnectPass("taosdata") config.SetConnectDB("test_ws_stmt") diff --git a/ws/tmq/consumer.go b/ws/tmq/consumer.go index 26da8e9..46ea559 100644 --- a/ws/tmq/consumer.go +++ b/ws/tmq/consumer.go @@ -6,6 +6,7 @@ import ( "encoding/binary" "errors" "fmt" + "net/url" "strconv" "sync" "sync/atomic" @@ -79,7 +80,12 @@ func NewConsumer(conf *tmq.ConfigMap) (*Consumer, error) { dialer := common.DefaultDialer dialer.EnableCompression = config.EnableCompression - ws, _, err := dialer.Dial(config.Url, nil) + u, err := url.Parse(config.Url) + if err != nil { + return nil, err + } + u.Path = "/rest/tmq" + ws, _, err := dialer.Dial(u.String(), nil) if err != nil { return nil, err } diff --git a/ws/tmq/consumer_test.go b/ws/tmq/consumer_test.go index ab43da2..4d382eb 100644 --- a/ws/tmq/consumer_test.go +++ b/ws/tmq/consumer_test.go @@ -124,7 +124,7 @@ func TestConsumer(t *testing.T) { } }() consumer, err := NewConsumer(&tmq.ConfigMap{ - "ws.url": "ws://127.0.0.1:6041/rest/tmq", + "ws.url": "ws://127.0.0.1:6041", "ws.message.channelLen": uint(0), "ws.message.timeout": common.DefaultMessageTimeout, "ws.message.writeWait": common.DefaultWriteWait, @@ -266,7 +266,7 @@ func TestSeek(t *testing.T) { } defer cleanSeekEnv() consumer, err := NewConsumer(&tmq.ConfigMap{ - "ws.url": "ws://127.0.0.1:6041/rest/tmq", + "ws.url": "ws://127.0.0.1:6041", "ws.message.channelLen": uint(0), "ws.message.timeout": common.DefaultMessageTimeout, "ws.message.writeWait": common.DefaultWriteWait, @@ -394,7 +394,7 @@ func TestAutoCommit(t *testing.T) { } defer cleanAutocommitEnv() consumer, err := NewConsumer(&tmq.ConfigMap{ - "ws.url": "ws://127.0.0.1:6041/rest/tmq", + "ws.url": "ws://127.0.0.1:6041", "ws.message.channelLen": uint(0), "ws.message.timeout": common.DefaultMessageTimeout, "ws.message.writeWait": common.DefaultWriteWait,