diff --git a/processor/package.json b/processor/package.json index 92d75e1708..0bea261009 100644 --- a/processor/package.json +++ b/processor/package.json @@ -22,7 +22,7 @@ "dependencies": { "1-click-bom": "https://github.com/kitspace/npm-1-click-bom#22d119c1c3c299ee98ef4bc887c75ca12881c92b", "@aws-sdk/client-s3": "^3.194.0", - "async-lock": "^1.3.2", + "async-lock": "^1.4.1", "bullmq": "^1.91.1", "cheerio": "^1.0.0-rc.10", "globule": "^1.0.0", diff --git a/processor/src/queues.ts b/processor/src/queues.ts index e6c60b71cc..e88b3d56bc 100644 --- a/processor/src/queues.ts +++ b/processor/src/queues.ts @@ -181,7 +181,7 @@ async function getGitHash(checkoutDir: string) { const lock = new AsyncLock() async function sync(gitDir, checkoutDir) { await lock - .acquire(gitDir, async done => { + .acquire(gitDir, async () => { log.info('Acquired sync lock for ', gitDir) const registryHash = getRegistryHash(gitDir) @@ -189,7 +189,6 @@ async function sync(gitDir, checkoutDir) { if (await exists(checkoutDir)) { if (registryHash != null) { // no need to pull if we aren't going to use the latest commit - done() return } @@ -203,11 +202,7 @@ async function sync(gitDir, checkoutDir) { "Your configuration specifies to merge with the ref 'refs/heads/master'\nfrom the remote, but no such ref was fetched.\n" ) { log.warn('repo without any branches', checkoutDir) - done() - return } - done(err) - return } } else { log.debug('Cloning ', gitDir) @@ -215,7 +210,6 @@ async function sync(gitDir, checkoutDir) { await sh`git clone ${gitDir} ${checkoutDir}` } catch (err) { if (err.stderr) { - done(err) return } } @@ -230,7 +224,6 @@ async function sync(gitDir, checkoutDir) { }) } } - done() }) .then(() => log.debug('Released sync lock for ', gitDir)) } diff --git a/processor/yarn.lock b/processor/yarn.lock index 93e3b376aa..f6289aa2da 100644 --- a/processor/yarn.lock +++ b/processor/yarn.lock @@ -1556,10 +1556,10 @@ assertion-error@^1.1.0: resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== -async-lock@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/async-lock/-/async-lock-1.3.2.tgz#56668613f91c1c55432b4db73e65c9ced664e789" - integrity sha512-phnXdS3RP7PPcmP6NWWzWMU0sLTeyvtZCxBPpZdkYE3seGLKSQZs9FrmVO/qwypq98FUtWWUEYxziLkdGk5nnA== +async-lock@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/async-lock/-/async-lock-1.4.1.tgz#56b8718915a9b68b10fce2f2a9a3dddf765ef53f" + integrity sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ== asynckit@^0.4.0: version "0.4.0"