从凤凰应用程序中的英雄库生产中删除记录



与这个问题类似,我问了如何在 Rails 应用程序中删除实时记录,如何在 Phoenix 中执行此操作 如何在 Rails 的生产中删除记录

我尝试了heroku run iex -S mix phx.server但是我得到了波纹管错误:

Simons-MBP:iotc Simon$ heroku run iex -S mix phx.server
Running iex -S mix phx.server on ⬢ icingonthecake... up, run.3732 (Free)
Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]
14:29:43.723 [info] Running Iotc.Web.Endpoint with Cowboy using http://:::54253
14:29:43.734 [error] Postgrex.Protocol (#PID<0.276.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp"
14:29:43.734 [error] Postgrex.Protocol (#PID<0.282.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp"
14:29:43.734 [error] Postgrex.Protocol (#PID<0.287.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp"
14:29:43.734 [error] Postgrex.Protocol (#PID<0.281.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp"
14:29:43.734 [error] Postgrex.Protocol (#PID<0.284.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp"
14:29:43.734 [error] Postgrex.Protocol (#PID<0.279.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp"
14:29:43.734 [error] Postgrex.Protocol (#PID<0.286.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp"

很可能是apps/<yourapp>/config/*.exs文件中的一个pool_size问题——如果你使用的是 Phoenix 1.3(不确定配置在 1.2 或更低版本中的位置(。我在本地计算机上将其设置为 60,如果我已经运行了控制台,我什至无法执行任何混合任务。我把pool_size降到了10,没事。

参考: https://github.com/elixir-ecto/postgrex/issues/210#issuecomment-239941678

最新更新