Skip to content

Commit

Permalink
Merge pull request #133 from SergeTupchiy/EMQX-9101-mnesia-unregister…
Browse files Browse the repository at this point in the history
…-hook

EMQX-9101 mnesia unregister hook
  • Loading branch information
SergeTupchiy committed Mar 22, 2023
2 parents a7686da + bb65dc0 commit 03e50ba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run_test_case.yaml
Expand Up @@ -12,13 +12,13 @@ jobs:
os:
- ubuntu20.04
otp:
- 24.3.4.2-1
- 25.1.2-2
- 24.3.4.2-3
- 25.1.2-3
elixir:
- 1.13.4
arch:
- amd64
container: ghcr.io/emqx/emqx-builder/5.0-26:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}
container: ghcr.io/emqx/emqx-builder/5.0-33:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}

steps:
- uses: actions/checkout@v1
Expand Down
1 change: 1 addition & 0 deletions src/mria_app.erl
Expand Up @@ -38,6 +38,7 @@ start(_Type, _Args) ->
mria_sup:start_link().

stop(_State) ->
mria_rlog:cleanup(),
mria_config:erase_all_config(),
?tp(notice, "Mria is stopped", #{}).

Expand Down
9 changes: 9 additions & 0 deletions src/mria_rlog.erl
Expand Up @@ -30,6 +30,7 @@
, subscribe/4
, wait_for_shards/2
, init/0
, cleanup/0

, intercept_trans/2
, ensure_shard/1
Expand Down Expand Up @@ -212,3 +213,11 @@ init() ->
_ ->
ok
end.

cleanup() ->
case mria_config:whoami() of
core ->
mnesia_hook:unregister_hook(post_commit);
_ ->
ok
end.

0 comments on commit 03e50ba

Please sign in to comment.