fix: don't start listener when update stopped listener

This commit is contained in:
Zhongwen Deng 2022-06-15 15:20:53 +08:00
parent ca17a372a4
commit 042b88db2d
1 changed files with 4 additions and 1 deletions

View File

@ -375,7 +375,10 @@ pre_config_update(_Path, _Request, RawConf) ->
post_config_update([listeners, Type, Name], {create, _Request}, NewConf, undefined, _AppEnvs) ->
start_listener(Type, Name, NewConf);
post_config_update([listeners, Type, Name], {update, _Request}, NewConf, OldConf, _AppEnvs) ->
restart_listener(Type, Name, {OldConf, NewConf});
case NewConf of
#{<<"enabled">> := true} -> restart_listener(Type, Name, {OldConf, NewConf});
_ -> ok
end;
post_config_update([listeners, _Type, _Name], '$remove', undefined, undefined, _AppEnvs) ->
{error, not_found};
post_config_update([listeners, Type, Name], '$remove', undefined, OldConf, _AppEnvs) ->