DEV: Minor code clean up in assets.rake. (#13245)

This commit is contained in:
Alan Guo Xiang Tan 2021-06-03 09:37:06 +08:00 committed by GitHub
parent b57dca90fc
commit 58cb120aa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -176,10 +176,9 @@ def compress(from, to)
end
def concurrent?
executor = Concurrent::FixedThreadPool.new(Concurrent.processor_count)
if ENV["SPROCKETS_CONCURRENT"] == "1"
concurrent_compressors = []
executor = Concurrent::FixedThreadPool.new(Concurrent.processor_count)
yield(Proc.new { |&block| concurrent_compressors << Concurrent::Future.execute(executor: executor) { block.call } })
concurrent_compressors.each(&:wait!)
else