aboutsummaryrefslogtreecommitdiff
path: root/src/gen_pubsub_node.erl
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2021-08-22 12:44:50 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2021-08-22 12:44:50 +0200
commit8d5025076f53abc0474c86a0f879ff1736714844 (patch)
tree06b8c8d9c4c4275d42e208628ad47aafdaf5e468 /src/gen_pubsub_node.erl
parentPubSub: Optimize publishing on large nodes (SQL) (diff)
PubSub: Add delete_old_pubsub_items command
Add a command for keeping only the specified number of items on each node and removing all older items. This might be especially useful if nodes may be configured to have no 'max_items' limit. Thanks to Ammonit Measurement GmbH for sponsoring this work.
Diffstat (limited to 'src/gen_pubsub_node.erl')
-rw-r--r--src/gen_pubsub_node.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gen_pubsub_node.erl b/src/gen_pubsub_node.erl
index 5bdebdfc6..625e490fc 100644
--- a/src/gen_pubsub_node.erl
+++ b/src/gen_pubsub_node.erl
@@ -123,6 +123,11 @@
{error, stanza_error()}.
-callback remove_extra_items(NodeIdx :: nodeIdx(),
+ Max_Items :: unlimited | non_neg_integer()) ->
+ {result, {[itemId()], [itemId()]}
+ }.
+
+-callback remove_extra_items(NodeIdx :: nodeIdx(),
Max_Items :: unlimited | non_neg_integer(),
ItemIds :: [itemId()]) ->
{result, {[itemId()], [itemId()]}