mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
Add better error messages for rate limits.
This commit is contained in:
parent
3620c8c85e
commit
0b4cb5cf0d
4 changed files with 34 additions and 5 deletions
|
@ -1,6 +1,10 @@
|
|||
require 'rate_limiter'
|
||||
class EditRateLimiter < RateLimiter
|
||||
def initialize(user)
|
||||
super(user, "edit-post:#{Date.today}", SiteSetting.max_edits_per_day, 1.day.to_i)
|
||||
super(user, "edit-post", SiteSetting.max_edits_per_day, 1.day.to_i)
|
||||
end
|
||||
|
||||
def build_key(type)
|
||||
"#{super(type)}:#{Date.today}"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue