chore(olp): add spec.

This commit is contained in:
William Yang 2021-10-05 09:47:21 +02:00
parent 6baf2dbd95
commit 547484a2d1
1 changed files with 13 additions and 0 deletions

View File

@ -29,6 +29,18 @@
, off/0 , off/0
]). ]).
-type cfg_key() ::
backoff_gc |
backoff_hibernation |
backoff_new_conn.
-type cnt_name() ::
'olp.delay.ok' |
'olp.delay.timeout' |
'olp.hbn' |
'olp.gc' |
'olp.new_conn'.
-define(overload_protection, overload_protection). -define(overload_protection, overload_protection).
-spec is_overloaded() -> boolean(). -spec is_overloaded() -> boolean().
@ -82,6 +94,7 @@ on() ->
load_ctl:restart_runq_flagman(). load_ctl:restart_runq_flagman().
%%% Internals %%% Internals
-spec do_check(Zone::atom(), cfg_key(), cnt_name()) -> boolean().
do_check(Zone, Key, CntName) -> do_check(Zone, Key, CntName) ->
case load_ctl:is_overloaded() of case load_ctl:is_overloaded() of
true -> true ->