mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
minor refactor
This commit is contained in:
parent
a69f59ef51
commit
d9df40dfcd
1 changed files with 3 additions and 2 deletions
|
@ -20,11 +20,12 @@ task 'assets:precompile:before' do
|
|||
digest = Digest::SHA1.hexdigest(data)
|
||||
key = "SPROCKETS_#{digest}"
|
||||
|
||||
unless compiled = $redis.get(key)
|
||||
if compiled = $redis.get(key)
|
||||
$redis.expire(key, 1.week)
|
||||
else
|
||||
compiled = Uglifier.new(:comments => :none).compile(data)
|
||||
$redis.setex(key, 1.week, compiled)
|
||||
end
|
||||
$redis.expire(key, 1.week)
|
||||
compiled
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue