From 2f1611f9185d3d4ce55fee3cef91b6ded5573976 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 30 Oct 2021 13:45:10 +0200 Subject: [PATCH] mod_pubsub: Fix get_max_items_node/1 specification Make it explicit that the get_max_items_node/1 function returns ?MAXITEMS if the 'max_items_node' option isn't specified. The function didn't actually fall back to 'undefined' (but to the 'max_items_node' default; i.e., ?MAXITEMS) anyway. This change just clarifies the behavior and adjusts the function specification accordingly. --- src/mod_pubsub.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index a36c6e645..34a95da85 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -3579,9 +3579,9 @@ check_opt_range(Opt, Opts, Max) -> Val -> Val =< Max end. --spec get_max_items_node(host()) -> undefined | unlimited | non_neg_integer(). +-spec get_max_items_node(host()) -> unlimited | non_neg_integer(). get_max_items_node(Host) -> - config(Host, max_items_node, undefined). + config(Host, max_items_node, ?MAXITEMS). -spec get_max_item_expire_node(host()) -> infinity | non_neg_integer(). get_max_item_expire_node(Host) ->