DEV: Trigger an event before creating an upload

This commit is contained in:
romanrizzi 2020-06-10 16:30:53 -03:00
parent b8acb36532
commit ac555610d9
1 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,8 @@ class UploadCreator
return @upload
end
DiscourseEvent.trigger(:before_upload_creation, @file)
DistributedMutex.synchronize("upload_#{user_id}_#{@filename}") do
# test for image regardless of input
@image_info = FastImage.new(@file) rescue nil