diff --git a/apps/efka/include/efka_tables.hrl b/apps/efka/include/efka_tables.hrl index 4ee566c..b4879c0 100644 --- a/apps/efka/include/efka_tables.hrl +++ b/apps/efka/include/efka_tables.hrl @@ -8,24 +8,6 @@ %%%------------------------------------------------------------------- -author("anlicheng"). -%% 用来保存微服务 --record(service, { - service_id :: binary(), - tar_url :: binary(), - %% 工作目录 - root_dir :: string(), - %% 配置信息 - config_json :: binary(), - %% 状态: 0: 停止, 1: 运行中 - status = 0 -}). - -%% 数据缓存 --record(task_log, { - task_id = 0 :: integer(), - logs = []:: list() -}). - %% id生成器 -record(id_generator, { id, diff --git a/apps/efka/src/efka.app.src b/apps/efka/src/efka.app.src index 064baa8..b9aa312 100644 --- a/apps/efka/src/efka.app.src +++ b/apps/efka/src/efka.app.src @@ -17,11 +17,6 @@ inets, ssl, public_key, - - %erts, - %runtime_tools, - %observer, - kernel, stdlib ]}, diff --git a/apps/efka/src/efka_app.erl b/apps/efka/src/efka_app.erl index 8eb53fa..e9fd753 100644 --- a/apps/efka/src/efka_app.erl +++ b/apps/efka/src/efka_app.erl @@ -20,6 +20,7 @@ start(_StartType, _StartArgs) -> stop(_State) -> ok. +%% 微服务和efka之间通过websocket协议通讯 start_ws_server() -> {ok, Props} = application:get_env(efka, ws_server), Acceptors = proplists:get_value(acceptors, Props, 50), diff --git a/apps/efka/src/efka_model_sup.erl b/apps/efka/src/efka_model_sup.erl deleted file mode 100644 index 5e0b72f..0000000 --- a/apps/efka/src/efka_model_sup.erl +++ /dev/null @@ -1,74 +0,0 @@ -%%%------------------------------------------------------------------- -%%% @author anlicheng -%%% @copyright (C) 2025, -%%% @doc -%%% -%%% @end -%%% Created : 18. 4月 2025 16:42 -%%%------------------------------------------------------------------- --module(efka_model_sup). --author("anlicheng"). --include("efka_tables.hrl"). - --behaviour(supervisor). - -%% API --export([start_link/0]). - -%% Supervisor callbacks --export([init/1]). - --define(SERVER, ?MODULE). - -%%%=================================================================== -%%% API functions -%%%=================================================================== - -%% @doc Starts the supervisor --spec(start_link() -> {ok, Pid :: pid()} | ignore | {error, Reason :: term()}). -start_link() -> - supervisor:start_link({local, ?SERVER}, ?MODULE, []). - -%%%=================================================================== -%%% Supervisor callbacks -%%%=================================================================== - -%% @private -%% @doc Whenever a supervisor is started using supervisor:start_link/[2,3], -%% this function is called by the new process to find out about -%% restart strategy, maximum restart frequency and child -%% specifications. -init([]) -> - SupFlags = #{strategy => one_for_one, intensity => 1000, period => 3600}, - Specs = [ - #{ - id => cache_model, - start => {cache_model, start_link, []}, - restart => permanent, - shutdown => 5000, - type => worker, - modules => ['cache_model'] - }, - #{ - id => service_model, - start => {service_model, start_link, []}, - restart => permanent, - shutdown => 5000, - type => worker, - modules => ['service_model'] - }, - #{ - id => task_log_model, - start => {task_log_model, start_link, []}, - restart => permanent, - shutdown => 5000, - type => worker, - modules => ['task_log_model'] - } - ], - - {ok, {SupFlags, Specs}}. - -%%%=================================================================== -%%% Internal functions -%%%=================================================================== \ No newline at end of file diff --git a/apps/efka/src/efka_sup.erl b/apps/efka/src/efka_sup.erl index 4eda96f..f24bc30 100644 --- a/apps/efka/src/efka_sup.erl +++ b/apps/efka/src/efka_sup.erl @@ -47,23 +47,14 @@ init([]) -> %}, #{ - id => 'efka_model_sup', - start => {'efka_model_sup', start_link, []}, + id => cache_model, + start => {cache_model, start_link, []}, restart => permanent, - shutdown => 2000, - type => supervisor, - modules => ['efka_model_sup'] + shutdown => 5000, + type => worker, + modules => ['cache_model'] }, - %#{ - % id => 'efka_inetd_task_log', - % start => {'efka_inetd_task_log', start_link, []}, - % restart => permanent, - % shutdown => 2000, - % type => worker, - % modules => ['efka_inetd_task_log'] - %}, - #{ id => 'efka_subscription', start => {'efka_subscription', start_link, []}, diff --git a/apps/efka/src/ws_channel.erl b/apps/efka/src/ws_channel.erl index ff7cb90..5d111cc 100644 --- a/apps/efka/src/ws_channel.erl +++ b/apps/efka/src/ws_channel.erl @@ -8,7 +8,6 @@ %%%------------------------------------------------------------------- -module(ws_channel). -author("licheng5"). --include("efka_service.hrl"). %% API -export([init/2]).