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]).
|
-import(hoconsc, [mk/2, enum/1, ref/2]).
|
||||||
|
|
||||||
-define(DYNAMO_HOST_OPTIONS, #{
|
-define(DYNAMO_HOST_OPTIONS, #{
|
||||||
default_port => 8000
|
default_port => 80
|
||||||
}).
|
}).
|
||||||
|
|
||||||
%%=====================================================================
|
%%=====================================================================
|
||||||
|
|
|
@ -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};
|
||||||
|
|
Loading…
Reference in New Issue