fix: bridge v2 `on_query` matched ChannelId

This commit is contained in:
JimMoen 2024-03-01 11:36:15 +08:00
parent 00d50479f5
commit 1d58092176
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

View File

@ -128,9 +128,9 @@
%% -type size() :: integer().
-type state() :: #{
installed_channels := map(),
pool_name := binary(),
resource_opts := map(),
sql_templates := map()
resource_opts := map()
}.
%%====================================================================
@ -288,14 +288,14 @@ on_stop(InstanceId, _State) ->
-spec on_query(
resource_id(),
{?ACTION_SEND_MESSAGE, map()},
Query :: {channel_id(), map()},
state()
) ->
ok
| {ok, list()}
| {error, {recoverable_error, term()}}
| {error, term()}.
on_query(ResourceId, {?ACTION_SEND_MESSAGE, _Msg} = Query, State) ->
on_query(ResourceId, {_ChannelId, _Msg} = Query, State) ->
?TRACE(
"SINGLE_QUERY_SYNC",
"bridge_sqlserver_received",
@ -305,7 +305,7 @@ on_query(ResourceId, {?ACTION_SEND_MESSAGE, _Msg} = Query, State) ->
-spec on_batch_query(
resource_id(),
[{?ACTION_SEND_MESSAGE, map()}],
[{channel_id(), map()}],
state()
) ->
ok
@ -383,7 +383,7 @@ conn_str([{_, _} | Opts], Acc) ->
%% Query with singe & batch sql statement
-spec do_query(
resource_id(),
Query :: {?ACTION_SEND_MESSAGE, map()} | [{?ACTION_SEND_MESSAGE, map()}],
Query :: {channel_id(), map()} | [{channel_id(), map()}],
ApplyMode :: handover,
state()
) ->

View File

@ -59,7 +59,7 @@ sqlserver_action.label:
"""Microsoft SOL Server Action Configuration"""
config_connector.desc:
"""Configuration for an Microsoft SOL Server connector."""
"""Configuration for a Microsoft SOL Server connector."""
config_connector.label:
"""Microsoft SOL Server Connector Configuration"""