vegabook
How to set a longer timeout on elixir grpc
I’m getting a timeout error in my (10-second or so long-running) grpc call over the internet:
{:error, %GRPC.RPCError{status: 4, message: “Deadline Exceeded”, details: nil}}
Here is the call. I’ve tried, both timeout and deadline, nothing works.
def intradayBarRequest(topic,
chan,
interval \ 60,
start_dtime \ date_back(DateTime.utc_now(), 6, :month),
end_dtime \ DateTime.utc_now()) do
sts = %Google.Protobuf.Timestamp{seconds: start_dtime |> DateTime.to_unix}
dbg(sts, label: :sts)
ets = %Google.Protobuf.Timestamp{seconds: end_dtime |> DateTime.to_unix}
dbg(ets, label: :ets)
tpc = %Bloomberg.IntradayBarRequest{topic: topic, start: sts, end: ets, interval: interval}
dbg(tpc, label: :tpc)
deadline = DateTime.add(DateTime.utc_now(), 60, :second) # 60 seconds
#Bloomberg.Bbg.Stub.intraday_bar_request(chan, tpc, metadata: [timeout: 60])
Bloomberg.Bbg.Stub.intraday_bar_request(chan, tpc, metadata: [deadline: deadline])
end
You can see where I setup the channel here.
Any ideas how to increase deadlines to this doesn’t happen?
Most Liked
vegabook
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









