mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 04:18:23 +00:00
DEV: Minor code clean up in assets.rake. (#13245)
This commit is contained in:
parent
b57dca90fc
commit
58cb120aa2
@ -176,10 +176,9 @@ def compress(from, to)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def concurrent?
|
def concurrent?
|
||||||
executor = Concurrent::FixedThreadPool.new(Concurrent.processor_count)
|
|
||||||
|
|
||||||
if ENV["SPROCKETS_CONCURRENT"] == "1"
|
if ENV["SPROCKETS_CONCURRENT"] == "1"
|
||||||
concurrent_compressors = []
|
concurrent_compressors = []
|
||||||
|
executor = Concurrent::FixedThreadPool.new(Concurrent.processor_count)
|
||||||
yield(Proc.new { |&block| concurrent_compressors << Concurrent::Future.execute(executor: executor) { block.call } })
|
yield(Proc.new { |&block| concurrent_compressors << Concurrent::Future.execute(executor: executor) { block.call } })
|
||||||
concurrent_compressors.each(&:wait!)
|
concurrent_compressors.each(&:wait!)
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user