fix
This commit is contained in:
parent
58756c3280
commit
1855d632c5
@ -7,7 +7,7 @@
|
||||
%%% @end
|
||||
%%% Created : 18. 4月 2025 16:50
|
||||
%%%-------------------------------------------------------------------
|
||||
-module(efka_micro_service).
|
||||
-module(efka_service).
|
||||
-author("anlicheng").
|
||||
-include("efka_tables.hrl").
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
%%% @end
|
||||
%%% Created : 18. 4月 2025 16:42
|
||||
%%%-------------------------------------------------------------------
|
||||
-module(efka_micro_service_sup).
|
||||
-module(efka_service_sup).
|
||||
-author("anlicheng").
|
||||
-include("efka_tables.hrl").
|
||||
|
||||
@ -47,7 +47,7 @@ start_link() ->
|
||||
init([]) ->
|
||||
SupFlags = #{strategy => one_for_one, intensity => 1000, period => 3600},
|
||||
|
||||
micro_service_model:insert(#micro_service{
|
||||
service_model:insert(#micro_service{
|
||||
service_id = <<"test1234">>,
|
||||
%% 工作目录
|
||||
root_dir = <<"/usr/local/code/tmp/test/">>,
|
||||
@ -57,7 +57,7 @@ init([]) ->
|
||||
status = 1
|
||||
}),
|
||||
|
||||
MicroServiceIds = micro_service_model:get_all_service_ids(),
|
||||
MicroServiceIds = service_model:get_all_service_ids(),
|
||||
Specs = lists:map(fun(ServiceId) -> child_spec(ServiceId) end, MicroServiceIds),
|
||||
|
||||
{ok, {SupFlags, [Specs]}}.
|
||||
@ -79,17 +79,17 @@ start_service(ServiceId) when is_binary(ServiceId) ->
|
||||
|
||||
-spec delete_service(ServiceId :: binary()) -> ok.
|
||||
delete_service(ServiceId) when is_binary(ServiceId) ->
|
||||
ChildId = efka_micro_service:get_name(ServiceId),
|
||||
ChildId = efka_service:get_name(ServiceId),
|
||||
ok = supervisor:terminate_child(?MODULE, ChildId),
|
||||
supervisor:delete_child(?MODULE, ChildId).
|
||||
|
||||
child_spec(ServiceId) when is_binary(ServiceId) ->
|
||||
Name = efka_micro_service:get_name(ServiceId),
|
||||
Name = efka_service:get_name(ServiceId),
|
||||
#{
|
||||
id => Name,
|
||||
start => {efka_micro_service, start_link, [Name, ServiceId]},
|
||||
start => {efka_service, start_link, [Name, ServiceId]},
|
||||
restart => permanent,
|
||||
shutdown => 2000,
|
||||
type => worker,
|
||||
modules => ['efka_micro_service']
|
||||
modules => ['efka_service']
|
||||
}.
|
||||
@ -6,7 +6,7 @@
|
||||
%%% @end
|
||||
%%% Created : 04. 7月 2023 12:31
|
||||
%%%-------------------------------------------------------------------
|
||||
-module(micro_cache_model).
|
||||
-module(cache_model).
|
||||
-author("aresei").
|
||||
-include("efka_tables.hrl").
|
||||
-include_lib("stdlib/include/qlc.hrl").
|
||||
@ -6,7 +6,7 @@
|
||||
%%% @end
|
||||
%%% Created : 04. 7月 2023 12:31
|
||||
%%%-------------------------------------------------------------------
|
||||
-module(micro_service_model).
|
||||
-module(service_model).
|
||||
-author("aresei").
|
||||
-include("efka_tables.hrl").
|
||||
-include_lib("stdlib/include/qlc.hrl").
|
||||
Loading…
x
Reference in New Issue
Block a user