File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
lib/realtime_web/channels/realtime_channel Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -138,13 +138,14 @@ defmodule RealtimeWeb.RealtimeChannel.PresenceHandler do
138
138
|> Phoenix.Presence . group ( )
139
139
end
140
140
141
+ @ presence_limit 1000
141
142
defp limit_presence_event ( socket ) do
142
143
% { assigns: % { presence_rate_counter: presence_counter , tenant: tenant_id } } = socket
143
144
{ :ok , rate_counter } = RateCounter . get ( presence_counter )
144
145
145
- tenant = Tenants.Cache . get_tenant_by_external_id ( tenant_id )
146
+ # tenant = Tenants.Cache.get_tenant_by_external_id(tenant_id)
146
147
147
- if rate_counter . avg > tenant . max_presence_events_per_second do
148
+ if rate_counter . avg > @ presence_limit do
148
149
{ :error , :rate_limit_exceeded }
149
150
else
150
151
GenCounter . add ( presence_counter . id )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ defmodule Realtime.MixProject do
4
4
def project do
5
5
[
6
6
app: :realtime ,
7
- version: "2.51.9 " ,
7
+ version: "2.51.10 " ,
8
8
elixir: "~> 1.17.3" ,
9
9
elixirc_paths: elixirc_paths ( Mix . env ( ) ) ,
10
10
start_permanent: Mix . env ( ) == :prod ,
You can’t perform that action at this time.
0 commit comments