mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: handle concurrently creating post reply keys
In some very rare conditions this would be called concurrently and fail
This commit is contained in:
@@ -262,7 +262,8 @@ module Email
|
||||
post_id &&
|
||||
header_value(Email::MessageBuilder::ALLOW_REPLY_BY_EMAIL_HEADER).present?
|
||||
|
||||
reply_key = PostReplyKey.find_or_create_by!(
|
||||
# use safe variant here cause we tend to see concurrency issue
|
||||
reply_key = PostReplyKey.find_or_create_by_safe!(
|
||||
post_id: post_id,
|
||||
user_id: user_id
|
||||
).reply_key
|
||||
|
Reference in New Issue
Block a user