Add mutex around incoming email processing
This commit is contained in:
parent
2a5a01af2e
commit
80435cf2af
|
@ -39,6 +39,8 @@ module Email
|
|||
|
||||
def process!
|
||||
return if is_blacklisted?
|
||||
DistributedMutex.synchronize(@message_id) do
|
||||
begin
|
||||
@from_email, @from_display_name = parse_from_field(@mail)
|
||||
@incoming_email = find_or_create_incoming_email
|
||||
process_internal
|
||||
|
@ -46,6 +48,8 @@ module Email
|
|||
@incoming_email.update_columns(error: e.to_s) if @incoming_email
|
||||
raise
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def is_blacklisted?
|
||||
return false if SiteSetting.ignore_by_title.blank?
|
||||
|
|
Loading…
Reference in New Issue