fix(Dynamo): fix DynamoDB bridge status check error
This commit is contained in:
parent
988e4ec1aa
commit
7ce04358c4
|
@ -34,7 +34,7 @@
|
|||
-import(hoconsc, [mk/2, enum/1, ref/2]).
|
||||
|
||||
-define(DYNAMO_HOST_OPTIONS, #{
|
||||
default_port => 8000
|
||||
default_port => 80
|
||||
}).
|
||||
|
||||
%%=====================================================================
|
||||
|
|
|
@ -71,8 +71,14 @@ init(#{
|
|||
{ok, #{}}.
|
||||
|
||||
handle_call(is_connected, _From, State) ->
|
||||
_ = erlcloud_ddb2:list_tables(),
|
||||
{reply, true, State};
|
||||
IsConnected =
|
||||
case erlcloud_ddb2:list_tables([{limit, 1}]) of
|
||||
{ok, _} ->
|
||||
true;
|
||||
_ ->
|
||||
false
|
||||
end,
|
||||
{reply, IsConnected, State};
|
||||
handle_call({query, Table, Query, Templates}, _From, State) ->
|
||||
Result = do_query(Table, Query, Templates),
|
||||
{reply, Result, State};
|
||||
|
|
Loading…
Reference in New Issue