Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/plugins/package/lib/zip-service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import archiver from 'archiver'
import os from 'os'
import path from 'path'
import path, { parse } from 'path'
import crypto from 'crypto'
import fs from 'fs'
import fsp from 'fs/promises'
Expand Down Expand Up @@ -102,9 +102,13 @@ export default {
const normalizedFiles = _.uniq(
files.map((file) => path.normalize(file)),
)
const concurrency = process.env.SLS_PACKAGE_CONCURRENCY ? parseInt(
process.env.SLS_PACKAGE_CONCURRENCY,
10,
) : os.cpus().length

return pMap(normalizedFiles, this.getFileContentAndStat.bind(this), {
concurrency: os.cpus().length,
concurrency,
})
.then((contents) => {
contents
Expand Down