Skip to content

Commit b0ddb36

Browse files
await release functions
1 parent a1112a6 commit b0ddb36

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libraries/Downloader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export function downloadBinary(binaryInfo: BinaryInfo, options: InternalServerOp
200200
return resolve(binaryPath)
201201
}
202202

203-
let releaseFunction: () => void;
203+
let releaseFunction: () => Promise<void>;
204204

205205
while (true) {
206206
try {
@@ -248,7 +248,7 @@ export function downloadBinary(binaryInfo: BinaryInfo, options: InternalServerOp
248248
if (downloadTries >= options.downloadRetries) {
249249
//Only reject if we have met the downloadRetries limit
250250
try {
251-
releaseFunction()
251+
await releaseFunction()
252252
} catch (e) {
253253
logger.error('An error occurred while releasing lock after downloadRetries exhaustion. The error was:', e)
254254
}

src/libraries/Executor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class Executor {
311311

312312
const copyPath = resolvePath(`${binaryFilepath}/../../lib/private/libaio.so.1`)
313313

314-
let lockRelease: () => void;
314+
let lockRelease: () => Promise<void>;
315315

316316
while(true) {
317317
try {
@@ -358,7 +358,7 @@ class Executor {
358358
} finally {
359359

360360
try {
361-
lockRelease()
361+
await lockRelease()
362362
} catch (e) {
363363
this.logger.error('Error unlocking libaio file:', e)
364364
}

0 commit comments

Comments
 (0)