Merge pull request #11150 from SergeTupchiy/wait-for-emqx_psk_tab
fix(emqx_psk): wait for Mria table on app start
This commit is contained in:
commit
9cf874e37e
|
@ -3,7 +3,7 @@
|
|||
{id, "emqx_machine"},
|
||||
{description, "The EMQX Machine"},
|
||||
% strict semver, bump manually!
|
||||
{vsn, "0.2.6"},
|
||||
{vsn, "0.2.7"},
|
||||
{modules, []},
|
||||
{registered, []},
|
||||
{applications, [kernel, stdlib, emqx_ctl]},
|
||||
|
|
|
@ -144,7 +144,8 @@ basic_reboot_apps() ->
|
|||
emqx_authz,
|
||||
emqx_slow_subs,
|
||||
emqx_auto_subscribe,
|
||||
emqx_plugins
|
||||
emqx_plugins,
|
||||
emqx_psk
|
||||
] ++ basic_reboot_apps_edition(emqx_release:edition()).
|
||||
|
||||
basic_reboot_apps_edition(ce) ->
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
%%--------------------------------------------------------------------
|
||||
%% Copyright (c) 2023 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||
%%
|
||||
%% Licensed under the Apache License, Version 2.0 (the "License");
|
||||
%% you may not use this file except in compliance with the License.
|
||||
%% You may obtain a copy of the License at
|
||||
%%
|
||||
%% http://www.apache.org/licenses/LICENSE-2.0
|
||||
%%
|
||||
%% Unless required by applicable law or agreed to in writing, software
|
||||
%% distributed under the License is distributed on an "AS IS" BASIS,
|
||||
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
%% See the License for the specific language governing permissions and
|
||||
%% limitations under the License.
|
||||
%%--------------------------------------------------------------------
|
||||
|
||||
-define(TAB, emqx_psk).
|
||||
|
||||
-define(PSK_SHARD, emqx_psk_shard).
|
|
@ -2,7 +2,7 @@
|
|||
{application, emqx_psk, [
|
||||
{description, "EMQX PSK"},
|
||||
% strict semver, bump manually!
|
||||
{vsn, "5.0.2"},
|
||||
{vsn, "5.0.3"},
|
||||
{modules, []},
|
||||
{registered, [emqx_psk_sup]},
|
||||
{applications, [kernel, stdlib]},
|
||||
|
|
|
@ -66,8 +66,7 @@
|
|||
|
||||
-boot_mnesia({mnesia, [boot]}).
|
||||
|
||||
-define(TAB, ?MODULE).
|
||||
-define(PSK_SHARD, emqx_psk_shard).
|
||||
-include("emqx_psk.hrl").
|
||||
|
||||
-define(DEFAULT_DELIMITER, <<":">>).
|
||||
|
||||
|
|
|
@ -23,7 +23,10 @@
|
|||
stop/1
|
||||
]).
|
||||
|
||||
-include("emqx_psk.hrl").
|
||||
|
||||
start(_Type, _Args) ->
|
||||
ok = mria:wait_for_tables([?TAB]),
|
||||
{ok, Sup} = emqx_psk_sup:start_link(),
|
||||
{ok, Sup}.
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Wait for Mria table when emqx_psk app is being started to ensure that
|
||||
PSK data is synced to replicant nodes even if they don't have init PSK file.
|
Loading…
Reference in New Issue