Hello, everyone,
I’m trying to get Finch working in my application to make HTTP requests to a third-party service. However, when I add Finch to my application.ex file in the children list like this:
{Finch,
name: FinchProcess,
pools: %{
default: [
conn_opts: [
transport_opts: [
ciphers: :ssl.cipher_suites(:default, :"tlsv1.2"),
verify: :verify_none
]
]
]
}
}
the process starts (I can see it in the observer) but calling Finch.request(FinchProcess)
results in an error.
[debug] [__exception__: true, __struct__: ArgumentError, message: "unknown registry: FinchProcess"]
If I instead call Finch.start_link()
at the beginning of my function, like this:
Finch.start_link(
name: FinchProcess,
pools: %{
default: [
conn_opts: [
transport_opts: [
ciphers: :ssl.cipher_suites(:default, :"tlsv1.2"),
verify: :verify_none
]
]
]
}
)
and then call Finch.request(FinchProcess)
everything works fine.
Does anybody have an idea why starting Finch via the first method, in application.ex, would start the process but cause Finch.request()
to not be able to find the process by name?