Skip to content

Commit 798be7d

Browse files
Peer discovery AWS, K8S: more Dialyzer fixes
1 parent d16037b commit 798be7d

File tree

6 files changed

+7
-10
lines changed

6 files changed

+7
-10
lines changed

deps/rabbit_common/src/rabbit_peer_discovery_backend.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@
5454

5555
-callback lock(Node :: atom()) -> {ok, Data :: term()} | not_supported | {error, Reason :: string()}.
5656

57-
-callback unlock(Data :: term()) -> ok | {error, Reason :: string()}.
57+
-callback unlock(Data :: term()) -> ok.
5858

5959
-optional_callbacks([init/0]).

deps/rabbitmq_peer_discovery_aws/src/rabbit_peer_discovery_aws.erl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,15 @@ lock(Node) ->
143143
Error
144144
end.
145145

146-
-spec unlock({{ResourceId :: string(), LockRequesterId :: node()}, Nodes :: [node()]}) ->
147-
ok | {error, Reason :: string()}.
148-
146+
-spec unlock({{ResourceId :: string(), LockRequestedId :: atom()}, Nodes :: [atom()]}) -> 'ok'.
149147
unlock({LockId, Nodes}) ->
150148
global:del_lock(LockId, Nodes),
151149
ok.
152150

153151
%%
154152
%% Implementation
155153
%%
154+
156155
-spec get_config_key(Key :: atom(), Map :: #{atom() => peer_discovery_config_value()})
157156
-> peer_discovery_config_value().
158157

deps/rabbitmq_peer_discovery_aws/src/rabbitmq_peer_discovery_aws.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ post_registration() ->
4949
lock(Node) ->
5050
?DELEGATE:lock(Node).
5151

52-
-spec unlock({ResourceId :: string(), LockRequesterId :: node()}) -> ok | {error, Reason :: string()}.
52+
-spec unlock({{ResourceId :: string(), LockRequestedId :: atom()}, Nodes :: [atom()]}) -> 'ok'.
5353
unlock(Data) ->
5454
?DELEGATE:unlock(Data).

deps/rabbitmq_peer_discovery_common/include/rabbit_peer_discovery.hrl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
% by `httpc`
1717
-define(DEFAULT_HTTP_TIMEOUT, 2250).
1818

19-
-type peer_discovery_config_value() :: atom() | integer() | string() | undefined.
19+
-type peer_discovery_config_value() :: atom() | integer() | string() | list() | map() | any() | undefined.
2020

2121
-record(peer_discovery_config_entry_meta,
2222
{env_variable :: string(),

deps/rabbitmq_peer_discovery_k8s/src/rabbit_peer_discovery_k8s.erl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ lock(Node) ->
9696
Error
9797
end.
9898

99-
-spec unlock({{ResourceId :: string(), LockRequesterId :: node()}, Nodes :: [node()]}) ->
100-
ok | {error, Reason :: string()}.
101-
99+
-spec unlock({{ResourceId :: string(), LockRequestedId :: atom()}, Nodes :: [atom()]}) -> 'ok'.
102100
unlock({LockId, Nodes}) ->
103101
global:del_lock(LockId, Nodes),
104102
ok.

deps/rabbitmq_peer_discovery_k8s/src/rabbitmq_peer_discovery_k8s.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ post_registration() ->
4848
lock(Node) ->
4949
?DELEGATE:lock(Node).
5050

51-
-spec unlock({ResourceId :: string(), LockRequesterId :: node()}) -> ok | {error, Reason :: string()}.
51+
-spec unlock({{ResourceId :: string(), LockRequestedId :: atom()}, Nodes :: [atom()]}) -> 'ok'.
5252
unlock(Data) ->
5353
?DELEGATE:unlock(Data).
5454

0 commit comments

Comments
 (0)