chore(resources): add missing parameters to emqx_resource schema
This commit is contained in:
parent
7e8381f4c7
commit
44a6e5ed15
|
@ -101,6 +101,14 @@
|
||||||
-define(HEALTHCHECK_INTERVAL, 15000).
|
-define(HEALTHCHECK_INTERVAL, 15000).
|
||||||
-define(HEALTHCHECK_INTERVAL_RAW, <<"15s">>).
|
-define(HEALTHCHECK_INTERVAL_RAW, <<"15s">>).
|
||||||
|
|
||||||
|
%% milliseconds
|
||||||
|
-define(START_TIMEOUT, 5000).
|
||||||
|
-define(START_TIMEOUT_RAW, <<"5s">>).
|
||||||
|
|
||||||
|
%% boolean
|
||||||
|
-define(START_AFTER_CREATED, true).
|
||||||
|
-define(START_AFTER_CREATED_RAW, <<"true">>).
|
||||||
|
|
||||||
%% milliseconds
|
%% milliseconds
|
||||||
-define(AUTO_RESTART_INTERVAL, 60000).
|
-define(AUTO_RESTART_INTERVAL, 60000).
|
||||||
-define(AUTO_RESTART_INTERVAL_RAW, <<"60s">>).
|
-define(AUTO_RESTART_INTERVAL_RAW, <<"60s">>).
|
||||||
|
|
|
@ -116,11 +116,6 @@ create_and_return_data(MgrId, ResId, Group, ResourceType, Config, Opts) ->
|
||||||
{ok, _Group, Data} = lookup(ResId),
|
{ok, _Group, Data} = lookup(ResId),
|
||||||
{ok, Data}.
|
{ok, Data}.
|
||||||
|
|
||||||
%% internal configs
|
|
||||||
-define(START_AFTER_CREATED, true).
|
|
||||||
%% in milliseconds
|
|
||||||
-define(START_TIMEOUT, 5000).
|
|
||||||
|
|
||||||
%% @doc Create a resource_manager and wait until it is running
|
%% @doc Create a resource_manager and wait until it is running
|
||||||
create(MgrId, ResId, Group, ResourceType, Config, Opts) ->
|
create(MgrId, ResId, Group, ResourceType, Config, Opts) ->
|
||||||
% The state machine will make the actual call to the callback/resource module after init
|
% The state machine will make the actual call to the callback/resource module after init
|
||||||
|
|
|
@ -46,6 +46,8 @@ fields("creation_opts") ->
|
||||||
[
|
[
|
||||||
{worker_pool_size, fun worker_pool_size/1},
|
{worker_pool_size, fun worker_pool_size/1},
|
||||||
{health_check_interval, fun health_check_interval/1},
|
{health_check_interval, fun health_check_interval/1},
|
||||||
|
{start_after_created, fun start_after_created/1},
|
||||||
|
{start_timeout, fun start_timeout/1},
|
||||||
{auto_restart_interval, fun auto_restart_interval/1},
|
{auto_restart_interval, fun auto_restart_interval/1},
|
||||||
{query_mode, fun query_mode/1},
|
{query_mode, fun query_mode/1},
|
||||||
{request_timeout, fun request_timeout/1},
|
{request_timeout, fun request_timeout/1},
|
||||||
|
@ -69,6 +71,18 @@ health_check_interval(default) -> ?HEALTHCHECK_INTERVAL_RAW;
|
||||||
health_check_interval(required) -> false;
|
health_check_interval(required) -> false;
|
||||||
health_check_interval(_) -> undefined.
|
health_check_interval(_) -> undefined.
|
||||||
|
|
||||||
|
start_after_created(type) -> boolean();
|
||||||
|
start_after_created(desc) -> ?DESC("start_after_created");
|
||||||
|
start_after_created(default) -> ?START_AFTER_CREATED_RAW;
|
||||||
|
start_after_created(required) -> false;
|
||||||
|
start_after_created(_) -> undefined.
|
||||||
|
|
||||||
|
start_timeout(type) -> emqx_schema:duration_ms();
|
||||||
|
start_timeout(desc) -> ?DESC("start_timeout");
|
||||||
|
start_timeout(default) -> ?START_TIMEOUT_RAW;
|
||||||
|
start_timeout(required) -> false;
|
||||||
|
start_timeout(_) -> undefined.
|
||||||
|
|
||||||
auto_restart_interval(type) -> hoconsc:union([infinity, emqx_schema:duration_ms()]);
|
auto_restart_interval(type) -> hoconsc:union([infinity, emqx_schema:duration_ms()]);
|
||||||
auto_restart_interval(desc) -> ?DESC("auto_restart_interval");
|
auto_restart_interval(desc) -> ?DESC("auto_restart_interval");
|
||||||
auto_restart_interval(default) -> ?AUTO_RESTART_INTERVAL_RAW;
|
auto_restart_interval(default) -> ?AUTO_RESTART_INTERVAL_RAW;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Expose additional resource configuration parameters: `start_after_created` and `start_timeout`.
|
|
@ -0,0 +1 @@
|
||||||
|
为桥接资源增加了配置参数:`start_after_created` 和 `start_timeout`。
|
Loading…
Reference in New Issue