mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
FIX: we need the sha of the upload to create a thumbnail
This commit is contained in:
parent
c1cf602de2
commit
bdfdbcd217
@ -8,6 +8,7 @@ class OptimizedImage < ActiveRecord::Base
|
||||
|
||||
def self.create_for(upload, width, height, opts={})
|
||||
return unless width > 0 && height > 0
|
||||
return if upload.try(:sha1).blank?
|
||||
|
||||
DistributedMutex.synchronize("optimized_image_#{upload.id}_#{width}_#{height}") do
|
||||
# do we already have that thumbnail?
|
||||
|
Loading…
Reference in New Issue
Block a user