-
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
Refactor PubSub subscriptions options implementation #2148
Conversation
c26552f
to
2b8632a
Compare
This comment has been minimized.
This comment has been minimized.
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.
Looks good to me. I spotted one place with duplicated code.
src/pubsub/mod_pubsub_db_mnesia.erl
Outdated
[ {J, S, SubId} | add_jid_to_subs(RSubs, J, RStates) ]. | ||
add_jid_and_opts_to_subs([{S, SubId} | RSubs], J, RStates) -> | ||
Opts = | ||
case mnesia:read({pubsub_subscription, SubId}) of |
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.
This case and the one in line 549 look the same to me. Would it be worth to extract it to a function?
end | ||
end, | ||
[], Plugins), | ||
PluginsOK = lists:foldl(pa:bind(fun init_plugin/5, Host, ServerHost, Opts), [], Plugins), |
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 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.
🍺
Codecov Report
@@ Coverage Diff @@
## master #2148 +/- ##
==========================================
+ Coverage 75.55% 77.69% +2.14%
==========================================
Files 327 327
Lines 28299 28230 -69
==========================================
+ Hits 21381 21934 +553
+ Misses 6918 6296 -622
Continue to review full report at Codecov.
|
5942.1 / Erlang 19.3 / small_tests / 084f51d 5942.3 / Erlang 19.3 / mysql_redis / 084f51d 5942.6 / Erlang 19.3 / elasticsearch_and_cassandra_mnesia / 084f51d 5942.2 / Erlang 19.3 / internal_mnesia / 084f51d 5942.4 / Erlang 19.3 / odbc_mssql_mnesia / 084f51d 5942.5 / Erlang 19.3 / ldap_mnesia / 084f51d 5942.8 / Erlang 20.0 / pgsql_mnesia / 084f51d 5942.9 / Erlang 21.0 / riak_mnesia / 084f51d 5942.9 / Erlang 21.0 / riak_mnesia / 084f51d |
This PR removes
pubsub_subscription
module, refactors opts forms processing and integrates options storage logic into DB backends. In case of RDBMS it's only a stub for now.