Просмотр исходного кода

fix bug with stoping pool worker

Yuriy Zhloba 8 лет назад
Родитель
Сommit
3099835375
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      src/epgsql_pool.erl
  2. 1 1
      src/epgsql_pool_worker.erl

+ 1 - 1
src/epgsql_pool.erl

@@ -40,7 +40,7 @@ start(PoolName0, InitCount, MaxCount, #epgsql_connection_params{} = ConnectionPa
                           {max_count, MaxCount},
                           {queue_max, MaxQueue},
                           {start_mfa, {epgsql_pool_worker, start_link, [PoolName]}},
-                          {stop_mfa, {epgsql_pool_worker, stop, []}}
+                          {stop_mfa, {epgsql_pool_worker, stop, ['$pooler_pid']}}
                          ],
             pooler:new_pool(PoolConfig)
     end.

+ 1 - 1
src/epgsql_pool_worker.erl

@@ -113,7 +113,7 @@ handle_info(keep_alive, #state{connection = #epgsql_connection{sock = undefined}
 handle_info(keep_alive, #state{connection = #epgsql_connection{sock = Sock},
                                no_reply_keep_alive_timer = NR_KA_Timer} = State) ->
     %% send async keep-alive query to DB
-    KA_Ref = epgsqli:squery(Sock, <<"SELECT 1">>),
+    KA_Ref = epgsqli:squery(Sock, "SELECT 1"),
 
     {ok, QueryTimeout} = application:get_env(epgsql_pool, query_timeout),
     erlang:cancel_timer(NR_KA_Timer),