@@ -71,10 +71,10 @@ start_link(Type) ->
71
71
72
72
start (Type , Host , Tag , PoolOpts , ConnOpts ) ->
73
73
ok = ensure_started (Type ),
74
- gen_server :call (name (Type ), {start_pool , Host , Tag , PoolOpts , ConnOpts }).
74
+ gen_server :call (name (Type ), {start_pool , Host , Tag , PoolOpts , ConnOpts }, timer : seconds ( 30 ) ).
75
75
76
76
stop (Type , Host , Tag ) ->
77
- gen_server :call (name (Type ), {stop_pool , Host , Tag }).
77
+ gen_server :call (name (Type ), {stop_pool , Host , Tag }, timer : seconds ( 30 ) ).
78
78
79
79
-spec name (mongoose_wpool :pool_type ()) -> mongoose_wpool :proc_name ().
80
80
name (Type ) ->
@@ -93,7 +93,11 @@ handle_call({start_pool, Host, Tag, WpoolOpts, ConnOpts}, _From,
93
93
# state {type = Type , pools = Pools , monitors = Monitors } = State ) ->
94
94
? LOG_INFO (#{what => pool_starting , pool_type => Type , tag => Tag , server => Host ,
95
95
pool_opts => WpoolOpts }),
96
- case mongoose_wpool :call_start_callback (Type , [Host , Tag , WpoolOpts , ConnOpts ]) of
96
+ F = fun () ->
97
+ mongoose_wpool :call_start_callback (Type , [Host , Tag , WpoolOpts , ConnOpts ])
98
+ end ,
99
+ Info = #{task => start_pool , tag => Tag },
100
+ case mongoose_task :run_tracked (Info , F ) of
97
101
{_ , Pid } = OkReply when is_pid (Pid ) ->
98
102
Ref = erlang :monitor (process , Pid ),
99
103
Key = {Type , Host , Tag },
0 commit comments