import java.util.concurrent.* import net.filebot.hash.* def threadPoolSize = Runtime.getRuntime().availableProcessors() def executor = Executors.newFixedThreadPool(threadPoolSize) executor.invokeAll(args.getFiles{ it.isVideo() }.collect{ f -> return { def attr_hash = f.xattr['crc32'] def calc_hash = VerificationUtilities.computeHash(f, HashType.SFV) println "$attr_hash $calc_hash $f" if (attr_hash == null) { log.warning "set xattr crc32 for [$f]" f.xattr['crc32'] = calc_hash } else if (attr_hash != calc_hash) { log.warning "crc32 mismatch (expected $attr_hash, actual: $calc_hash) for [$f]" } } })*.get()