mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-23 13:26:22 -04:00
FIX: we need the sha of the upload to create a thumbnail
This commit is contained in:
parent
c1cf602de2
commit
bdfdbcd217
1 changed files with 1 additions and 0 deletions
|
@ -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 a new issue