Skip to content

Commit

Permalink
allow http1 connections (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
Th3-M4jor authored Oct 18, 2023
1 parent b2b660b commit 1ec397f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/nostrum/api/ratelimiter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ defmodule Nostrum.Api.Ratelimiter do
`0.8`, nostrum used to use a `GenServer` that would call out to ETS tables to
look up ratelimiting buckets for requests. If it needed to sleep before
issuing a request due to the bucket being exhausted, it would do so in the
server process and block other callers.
server process and block other callers.
In nostrum 0.8, the existing ratelimiter bucket storage architecture was
refactored to be based around the [pluggable caching
Expand Down Expand Up @@ -377,7 +377,7 @@ defmodule Nostrum.Api.Ratelimiter do
{:keep_state, %{data | conn: conn_pid}}
end

def connecting(:info, {:gun_up, conn_pid, :http2}, %{conn: conn_pid} = data) do
def connecting(:info, {:gun_up, conn_pid, _}, %{conn: conn_pid} = data) do
{:next_state, :connected, data}
end

Expand Down Expand Up @@ -865,7 +865,7 @@ defmodule Nostrum.Api.Ratelimiter do
{:next_event, :internal, {:requeue, {request, from}}}}
end

def connected(:info, {:gun_down, conn, :http2, reason, killed_streams}, %{running: running}) do
def connected(:info, {:gun_down, conn, _, reason, killed_streams}, %{running: running}) do
# Even with `retry: 0`, gun seems to try and reconnect, potentially because
# of WebSocket. Force the connection to die.
:ok = :gun.close(conn)
Expand Down

0 comments on commit 1ec397f

Please sign in to comment.