try catch around semaphore lock

This commit is contained in:
Ulf Gebhardt 2023-01-16 11:04:14 +01:00
parent e59d2f0a0e
commit dab7fe584a
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -170,6 +170,7 @@ export class TransactionLinkResolver {
if (code.match(/^CL-/)) {
// acquire lock
const releaseLock = await TRANSACTIONS_LOCK.acquire()
try {
logger.info('redeem contribution link...')
const now = new Date()
const queryRunner = getConnection().createQueryRunner()
@ -312,6 +313,8 @@ export class TransactionLinkResolver {
throw new Error(`Creation from contribution link was not successful. ${e}`)
} finally {
await queryRunner.release()
}
} finally {
releaseLock()
}
return true