projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Merge branch 'features/hashtag-column' into 'develop'"
[akkoma]
/
lib
/
pleroma
/
web
/
plugs
/
rate_limiter.ex
diff --git
a/lib/pleroma/web/plugs/rate_limiter.ex
b/lib/pleroma/web/plugs/rate_limiter.ex
index a589610d1997824a4ef11501e2f7afdf8e10cb79..034a5bbe242731ecd47696feccc52af9debdd16a 100644
(file)
--- a/
lib/pleroma/web/plugs/rate_limiter.ex
+++ b/
lib/pleroma/web/plugs/rate_limiter.ex
@@
-72,6
+72,8
@@
defmodule Pleroma.Web.Plugs.RateLimiter do
require Logger
require Logger
+ @cachex Pleroma.Config.get([:cachex, :provider], Cachex)
+
@doc false
def init(plug_opts) do
plug_opts
@doc false
def init(plug_opts) do
plug_opts
@@
-124,7
+126,7
@@
defmodule Pleroma.Web.Plugs.RateLimiter do
key_name = make_key_name(action_settings)
limit = get_limits(action_settings)
key_name = make_key_name(action_settings)
limit = get_limits(action_settings)
- case
C
achex.get(bucket_name, key_name) do
+ case
@c
achex.get(bucket_name, key_name) do
{:error, :no_cache} ->
@inspect_bucket_not_found
{:error, :no_cache} ->
@inspect_bucket_not_found
@@
-157,7
+159,7
@@
defmodule Pleroma.Web.Plugs.RateLimiter do
key_name = make_key_name(action_settings)
limit = get_limits(action_settings)
key_name = make_key_name(action_settings)
limit = get_limits(action_settings)
- case
C
achex.get_and_update(bucket_name, key_name, &increment_value(&1, limit)) do
+ case
@c
achex.get_and_update(bucket_name, key_name, &increment_value(&1, limit)) do
{:commit, value} ->
{:ok, value}
{:commit, value} ->
{:ok, value}