-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mam retraction events #3497
Mam retraction events #3497
Conversation
small_tests_24 / small_tests / e762c53 small_tests_23 / small_tests / e762c53 dynamic_domains_mysql_redis_24 / mysql_redis / e762c53 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / e762c53 |
Codecov Report
@@ Coverage Diff @@
## master #3497 +/- ##
==========================================
- Coverage 81.00% 80.96% -0.04%
==========================================
Files 418 418
Lines 32329 32333 +4
==========================================
- Hits 26187 26180 -7
- Misses 6142 6153 +11
Continue to review full report at Codecov.
|
e762c53
to
c09b867
Compare
small_tests_24 / small_tests / c09b867 small_tests_23 / small_tests / c09b867 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / c09b867 dynamic_domains_mysql_redis_24 / mysql_redis / c09b867 dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / c09b867 dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / c09b867 ldap_mnesia_24 / ldap_mnesia / c09b867 ldap_mnesia_23 / ldap_mnesia / c09b867 internal_mnesia_24 / internal_mnesia / c09b867 pgsql_mnesia_24 / pgsql_mnesia / c09b867 pgsql_mnesia_23 / pgsql_mnesia / c09b867 elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / c09b867 mysql_redis_24 / mysql_redis / c09b867 mssql_mnesia_24 / odbc_mssql_mnesia / c09b867 riak_mnesia_24 / riak_mnesia / c09b867 |
src/mongoose_hooks.erl
Outdated
mod_mam_rdbms_arch:env_vars()) -> | ||
mod_mam_utils:retraction_info(). | ||
mam_retraction(HostType, RetractionInfo, Env) -> | ||
{ok, RetractionInfo1} = gen_hook:run_fold(mam_retraction, HostType, RetractionInfo, Env), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a helper for calling hooks at the bottom of this file. It also handles the ok/stop
matching (discarding both actually).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use the helper and revert the change for returning {stop, NewAcc}
in case of a stopped hook in gen_hook.erl
. We may not use it now, but at least it's not surprising that it's getting changed to an ok
if we ever would want to...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that helper 😄
c09b867
to
c085988
Compare
c085988
to
4185838
Compare
small_tests_24 / small_tests / 4185838 small_tests_23 / small_tests / 4185838 dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 4185838 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 4185838 ldap_mnesia_23 / ldap_mnesia / 4185838 dynamic_domains_mysql_redis_24 / mysql_redis / 4185838 dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 4185838 ldap_mnesia_24 / ldap_mnesia / 4185838 internal_mnesia_24 / internal_mnesia / 4185838 pgsql_mnesia_23 / pgsql_mnesia / 4185838 pgsql_mnesia_24 / pgsql_mnesia / 4185838 mysql_redis_24 / mysql_redis / 4185838 elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 4185838 mssql_mnesia_24 / odbc_mssql_mnesia / 4185838 riak_mnesia_24 / riak_mnesia / 4185838 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds a new useful hook. LGTM 👍
Different handlers might want to listen on when a retraction happens, for example if the message being deleted wants to be rescued before being lost forever, or if we want metrics for it.