25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Define batch delete function types in coresponding behaviours

This commit is contained in:
Paweł Chmielowski 2022-06-17 10:35:02 +02:00
parent a2efde185a
commit 46c947bc76
2 changed files with 18 additions and 2 deletions

View File

@ -89,7 +89,18 @@
{[{binary(), non_neg_integer(), xmlel()}], boolean(), count()} |
{error, db_failure}.
-optional_callbacks([use_cache/1, cache_nodes/1, select_with_mucsub/6, select/6, select/7]).
-callback delete_old_messages_batch(binary(), erlang:timestamp(),
all | chat | groupchat,
pos_integer()) ->
{ok, non_neg_integer()} | {error, term()}.
-callback delete_old_messages_batch(binary(), erlang:timestamp(),
all | chat | groupchat,
pos_integer(), any()) ->
{ok, any(), non_neg_integer()} | {error, term()}.
-optional_callbacks([use_cache/1, cache_nodes/1, select_with_mucsub/6, select/6, select/7,
delete_old_messages_batch/5, delete_old_messages_batch/4]).
%%%===================================================================
%%% API

View File

@ -106,9 +106,14 @@
-callback count_messages(binary(), binary()) -> {ets_cache:tag(), non_neg_integer()}.
-callback use_cache(binary()) -> boolean().
-callback cache_nodes(binary()) -> [node()].
-callback remove_old_messages_batch(binary(), non_neg_integer(), pos_integer()) ->
{ok, non_neg_integer()} | {error, term()}.
-callback remove_old_messages_batch(binary(), non_neg_integer(), pos_integer(), any()) ->
{ok, any(), non_neg_integer()} | {error, term()}.
-optional_callbacks([remove_expired_messages/1, remove_old_messages/2,
use_cache/1, cache_nodes/1]).
use_cache/1, cache_nodes/1, remove_old_messages_batch/3,
remove_old_messages_batch/4]).
depends(_Host, _Opts) ->
[].