微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

发布订阅升级时的 Elixir 未知注册表错误

如何解决发布订阅升级时的 Elixir 未知注册表错误

我最近按照文档升级了项目中的 pubsub 依赖项,但每次运行服务器时都会收到此错误

an exception was raised:
** (ArgumentError) unkNown registry: Demo.PubSub
    (elixir 1.10.2) lib/registry.ex:1239: Registry.info!/1
    (elixir 1.10.2) lib/registry.ex:920: Registry.register/3
    (phoenix_pubsub 2.0.0) lib/phoenix/pubsub.ex:117: Phoenix.PubSub.subscribe/3
    (phoenix 1.5.8) lib/phoenix/channel/server.ex:420: Phoenix.Channel.Server.init_join/3
    (phoenix 1.5.8) lib/phoenix/channel/server.ex:378: Phoenix.Channel.Server.channel_join/4
    (phoenix 1.5.8) lib/phoenix/channel/server.ex:298: Phoenix.Channel.Server.handle_info/2
    (stdlib 3.7) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib 3.7) gen_server.erl:711: :gen_server.handle_msg/6

这是我的应用程序.ex

def start(_type,_args) do
# List all child processes to be supervised
children = [
  Demo.Repo,DemoWeb.Endpoint,{Demo.ExpireCodesJob,[]},{Demo.distributeCodesJob,{Oban,oban_config()},{Phoenix.PubSub,[name: Demo.PubSub,adapter: Phoenix.PubSub.PG2]},worker(PlugAttack.Storage.Ets,[Demo.PlugAttack.Storage,[clean_period: 60_000]])
]

这是我的 config.ex

# Configures the endpoint
config :demo,url: [host: System.get_env("HOST")],secret_key_base: System.get_env("SECRET_KEY_BASE"),render_errors: [view: DemoWeb.ErrorView,accepts: ~w(json)],pubsub_server: Demo.PubSub,check_origin: [...]

我已经搜索了很多关于它,但由于我仍然是一个新手,无法弄清楚哪里出了问题。请帮帮我。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。