Merge pull request #10494 from lafirest/fix/dynamo_status

fix(Dynamo): fix DynamoDB bridge status check error
This commit is contained in:
lafirest 2023-04-24 18:53:57 +08:00 committed by GitHub
commit 06cab0b8fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -34,7 +34,7 @@
-import(hoconsc, [mk/2, enum/1, ref/2]). -import(hoconsc, [mk/2, enum/1, ref/2]).
-define(DYNAMO_HOST_OPTIONS, #{ -define(DYNAMO_HOST_OPTIONS, #{
default_port => 8000 default_port => 80
}). }).
%%===================================================================== %%=====================================================================

View File

@ -71,8 +71,14 @@ init(#{
{ok, #{}}. {ok, #{}}.
handle_call(is_connected, _From, State) -> handle_call(is_connected, _From, State) ->
_ = erlcloud_ddb2:list_tables(), IsConnected =
{reply, true, State}; case erlcloud_ddb2:list_tables([{limit, 1}]) of
{ok, _} ->
true;
_ ->
false
end,
{reply, IsConnected, State};
handle_call({query, Table, Query, Templates}, _From, State) -> handle_call({query, Table, Query, Templates}, _From, State) ->
Result = do_query(Table, Query, Templates), Result = do_query(Table, Query, Templates),
{reply, Result, State}; {reply, Result, State};