Add: 絵文字リアクションのレートリミット (#575)
This commit is contained in:
parent
7411941885
commit
9a3c8c5bda
2 changed files with 8 additions and 0 deletions
|
@ -14,6 +14,11 @@ class RateLimiter
|
|||
period: 3.hours.freeze,
|
||||
}.freeze,
|
||||
|
||||
emoji_reactions: {
|
||||
limit: 300,
|
||||
period: 3.hours.freeze,
|
||||
}.freeze,
|
||||
|
||||
reports: {
|
||||
limit: 400,
|
||||
period: 24.hours.freeze,
|
||||
|
|
|
@ -16,11 +16,14 @@
|
|||
|
||||
class EmojiReaction < ApplicationRecord
|
||||
include Paginable
|
||||
include RateLimitable
|
||||
|
||||
EMOJI_REACTION_LIMIT = 32_767
|
||||
EMOJI_REACTION_PER_ACCOUNT_LIMIT = ENV.fetch('EMOJI_REACTION_PER_ACCOUNT_LIMIT', 3).to_i
|
||||
EMOJI_REACTION_PER_REMOTE_ACCOUNT_LIMIT = ENV.fetch('EMOJI_REACTION_PER_REMOTE_ACCOUNT_LIMIT', 3).to_i
|
||||
|
||||
rate_limit by: :account, family: :emoji_reactions
|
||||
|
||||
update_index('statuses', :status)
|
||||
|
||||
scope :local, -> { where(uri: nil) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue