fix(resource): make some resource opts internal
Resource options `start_after_created` and `start_timeout` are internal opts. Not provided to users anymore.
This commit is contained in:
parent
2648362c62
commit
7c4ea38c06
|
@ -145,8 +145,8 @@ emqx_resource_schema {
|
||||||
|
|
||||||
queue_max_bytes {
|
queue_max_bytes {
|
||||||
desc {
|
desc {
|
||||||
en: """Maximum queue storage size in bytes."""
|
en: """Maximum queue storage."""
|
||||||
zh: """消息队列的最大长度,以字节计。"""
|
zh: """消息队列的最大长度。"""
|
||||||
}
|
}
|
||||||
label {
|
label {
|
||||||
en: """Queue max bytes"""
|
en: """Queue max bytes"""
|
||||||
|
|
|
@ -95,12 +95,6 @@
|
||||||
-define(HEALTHCHECK_INTERVAL, 15000).
|
-define(HEALTHCHECK_INTERVAL, 15000).
|
||||||
-define(HEALTHCHECK_INTERVAL_RAW, <<"15s">>).
|
-define(HEALTHCHECK_INTERVAL_RAW, <<"15s">>).
|
||||||
|
|
||||||
-define(START_AFTER_CREATED, true).
|
|
||||||
|
|
||||||
%% milliseconds
|
|
||||||
-define(START_TIMEOUT, 5000).
|
|
||||||
-define(START_TIMEOUT_RAW, <<"5s">>).
|
|
||||||
|
|
||||||
%% milliseconds
|
%% milliseconds
|
||||||
-define(AUTO_RESTART_INTERVAL, 60000).
|
-define(AUTO_RESTART_INTERVAL, 60000).
|
||||||
-define(AUTO_RESTART_INTERVAL_RAW, <<"60s">>).
|
-define(AUTO_RESTART_INTERVAL_RAW, <<"60s">>).
|
||||||
|
|
|
@ -114,6 +114,11 @@ 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,8 +46,6 @@ 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},
|
||||||
{async_inflight_window, fun async_inflight_window/1},
|
{async_inflight_window, fun async_inflight_window/1},
|
||||||
|
@ -70,18 +68,6 @@ 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(required) -> false;
|
|
||||||
start_after_created(default) -> ?START_AFTER_CREATED;
|
|
||||||
start_after_created(desc) -> ?DESC("start_after_created");
|
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue