fix(relup): add module emqx_relup
This commit is contained in:
parent
2365d1e983
commit
17440b2b53
|
@ -49,13 +49,14 @@ inject_relup_instrs(Type, CurrRelVsn, RUs) ->
|
|||
%% the instruction lists.
|
||||
append_emqx_relup_instrs(Type, CurrRelVsn, Vsn, Instrs) ->
|
||||
CallbackFun = relup_callback_func(Type),
|
||||
Extra = #{}, %% we may need some extended args
|
||||
case lists:reverse(Instrs) of
|
||||
[{apply, {emqx_relup, CallbackFun, _}} | _] ->
|
||||
Instrs;
|
||||
RInstrs ->
|
||||
lists:reverse([ {load_object_code, {emqx, CurrRelVsn, [emqx_relup]}}
|
||||
, {load, {emqx_relup, brutal_purge, soft_purge}}
|
||||
, {apply, {emqx_relup, CallbackFun, [CurrRelVsn, Vsn]}}
|
||||
, {apply, {emqx_relup, CallbackFun, [CurrRelVsn, Vsn, Extra]}}
|
||||
| RInstrs])
|
||||
end.
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
-module(emqx_relup).
|
||||
|
||||
-export([ post_release_upgrade/3
|
||||
, post_release_downgrade/3
|
||||
]).
|
||||
|
||||
post_release_upgrade(_CurrRelVsn, _FromVsn, _) ->
|
||||
reload_components().
|
||||
|
||||
post_release_downgrade(_CurrRelVsn, _ToVsn, _) ->
|
||||
reload_components().
|
||||
|
||||
reload_components() ->
|
||||
io:format("reloading resource providers ..."),
|
||||
emqx_rule_engine:load_providers(),
|
||||
io:format("loading plugins ..."),
|
||||
emqx_plugins:load().
|
Loading…
Reference in New Issue