chore(psk): catch timeout exception to avoid crash
This commit is contained in:
parent
98ecafcceb
commit
f325d7c783
|
@ -91,7 +91,7 @@ on_psk_lookup(PSKIdentity, _UserState) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
import(SrcFile) ->
|
import(SrcFile) ->
|
||||||
gen_server:call(?MODULE, {import, SrcFile}).
|
call({import, SrcFile}).
|
||||||
|
|
||||||
-spec start_link() -> {ok, pid()} | ignore | {error, term()}.
|
-spec start_link() -> {ok, pid()} | ignore | {error, term()}.
|
||||||
start_link() ->
|
start_link() ->
|
||||||
|
@ -220,3 +220,11 @@ trans(Fun, Args) ->
|
||||||
{atomic, Res} -> Res;
|
{atomic, Res} -> Res;
|
||||||
{aborted, Reason} -> {error, Reason}
|
{aborted, Reason} -> {error, Reason}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
call(Request) ->
|
||||||
|
try
|
||||||
|
gen_server:call(?MODULE, Request, 10000)
|
||||||
|
catch
|
||||||
|
exit:{timeout, _Details} ->
|
||||||
|
{error, timeout}
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue