@@ -5,8 +5,6 @@ defmodule Postgrex.TypeServer do
55
66 defstruct [ :types , :connections , :lock , :waiting ]
77
8- @ timeout 60_000
9-
108 @ doc """
119 Starts a type server.
1210 """
@@ -24,8 +22,10 @@ defmodule Postgrex.TypeServer do
2422 @ spec fetch ( pid ) ::
2523 { :lock , reference , Postgrex.Types . state ( ) } | :noproc | :error
2624 def fetch ( server ) do
25+ timeout = Application . fetch_env! ( :postgrex , :type_server_timeout )
26+
2727 try do
28- GenServer . call ( server , :fetch , @ timeout )
28+ GenServer . call ( server , :fetch , timeout )
2929 catch
3030 # module timed out, pretend it did not exist.
3131 :exit , { :normal , _ } -> :noproc
@@ -38,7 +38,8 @@ defmodule Postgrex.TypeServer do
3838 """
3939 @ spec update ( pid , reference , [ Postgrex.TypeInfo . t ( ) ] ) :: :ok
4040 def update ( server , ref , [ _ | _ ] = type_infos ) do
41- GenServer . call ( server , { :update , ref , type_infos } , @ timeout )
41+ timeout = Application . fetch_env! ( :postgrex , :type_server_timeout )
42+ GenServer . call ( server , { :update , ref , type_infos } , timeout )
4243 end
4344
4445 def update ( server , ref , [ ] ) do
0 commit comments