开发一款灵丹妙药应用。有一个刮板功能,它通过Postgrex驱动程序将数据从Google电子表格复制到postgres数据库。通过Google的连接可以正常工作,但是函数总是在15秒后超时。
01:48:36.654 [info] Running MyApp.Endpoint with Cowboy using http://localhost:80
Interactive Elixir (1.6.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Scraper.update
542
iex(2)> 01:48:55.889 [error] Postgrex.Protocol (#PID<0.324.0>) disconnected: ** (DBConnection.ConnectionError) owner #PID<0.445.0> timed out because it owned the connection for longer than 15000ms我尝试在源代码中的任何地方更改15_000 ms超时设置,但该设置似乎已被编译为二进制设置。我不是erlang/长生不老药开发人员,我只是帮助客户端安装这个应用程序,目的是为了降级。我的问题是:
发布于 2018-10-12 16:22:38
在使用postgrex发出查询时,最后一个参数可以是一个关键字选项列表。
Postgrex.query!(pid, "AN SQL STATEMENT;", [], timeout: 50_000, pool_timeout: 40_000)发布于 2018-10-13 04:18:35
config :my_app, MyApp.Repo,
adapter: Ecto.Adapters.Postgres,
username: "postgres",
password: "postgres",
database: "my_app_dev",
hostname: "localhost",
timeout: 600_000,
ownership_timeout: 600_000,
pool_timeout: 600_000看看timeout和ownership_timeout。这些值设置为600秒。而且可能不需要其中任何一种。
另外,我想说的是,有一次,我不得不从_build中删除所有内容,并重新编译一个应用程序,以便实际应用这个值。
https://stackoverflow.com/questions/52781738
复制相似问题