Drop compatibility with Redis < 6.2 (#30413)

This commit is contained in:
Claire 2025-05-20 14:55:42 +02:00 committed by GitHub
parent d7cb6068b1
commit f94b1fce41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View file

@ -58,7 +58,7 @@ Mastodon is a **free, open-source social network server** based on ActivityPub w
### Requirements
- **PostgreSQL** 12+
- **Redis** 4+
- **Redis** 6.2+
- **Ruby** 3.2+
- **Node.js** 18+

View file

@ -177,9 +177,7 @@ class Auth::SessionsController < Devise::SessionsController
)
# Only send a notification email every hour at most
return if redis.get("2fa_failure_notification:#{user.id}").present?
redis.set("2fa_failure_notification:#{user.id}", '1', ex: 1.hour)
return if redis.set("2fa_failure_notification:#{user.id}", '1', ex: 1.hour, get: true).present?
UserMailer.failed_2fa(user, request.remote_ip, request.user_agent, Time.now.utc).deliver_later!
end