simple code

This commit is contained in:
anlicheng 2025-09-29 15:11:22 +08:00
parent 4a81d1f6f9
commit 3ac8b18c98
6 changed files with 6 additions and 112 deletions

View File

@ -8,24 +8,6 @@
%%%------------------------------------------------------------------- %%%-------------------------------------------------------------------
-author("anlicheng"). -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生成器 %% id生成器
-record(id_generator, { -record(id_generator, {
id, id,

View File

@ -17,11 +17,6 @@
inets, inets,
ssl, ssl,
public_key, public_key,
%erts,
%runtime_tools,
%observer,
kernel, kernel,
stdlib stdlib
]}, ]},

View File

@ -20,6 +20,7 @@ start(_StartType, _StartArgs) ->
stop(_State) -> stop(_State) ->
ok. ok.
%% efka之间通过websocket协议通讯
start_ws_server() -> start_ws_server() ->
{ok, Props} = application:get_env(efka, ws_server), {ok, Props} = application:get_env(efka, ws_server),
Acceptors = proplists:get_value(acceptors, Props, 50), Acceptors = proplists:get_value(acceptors, Props, 50),

View File

@ -1,74 +0,0 @@
%%%-------------------------------------------------------------------
%%% @author anlicheng
%%% @copyright (C) 2025, <COMPANY>
%%% @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
%%%===================================================================

View File

@ -47,23 +47,14 @@ init([]) ->
%}, %},
#{ #{
id => 'efka_model_sup', id => cache_model,
start => {'efka_model_sup', start_link, []}, start => {cache_model, start_link, []},
restart => permanent, restart => permanent,
shutdown => 2000, shutdown => 5000,
type => supervisor, type => worker,
modules => ['efka_model_sup'] 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', id => 'efka_subscription',
start => {'efka_subscription', start_link, []}, start => {'efka_subscription', start_link, []},

View File

@ -8,7 +8,6 @@
%%%------------------------------------------------------------------- %%%-------------------------------------------------------------------
-module(ws_channel). -module(ws_channel).
-author("licheng5"). -author("licheng5").
-include("efka_service.hrl").
%% API %% API
-export([init/2]). -export([init/2]).