mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 02:53:38 +08:00
minor refactor
This commit is contained in:
parent
a69f59ef51
commit
d9df40dfcd
|
@ -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 New Issue
Block a user