Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
16 lines
776 B
Plaintext
16 lines
776 B
Plaintext
export const rollbackTransaction = async function rollbackTransaction(incomingID = '') {
|
|
const transactionID = incomingID instanceof Promise ? await incomingID : incomingID;
|
|
// if multiple operations are using the same transaction, the first will flow through and delete the session.
|
|
// subsequent calls should be ignored.
|
|
if (!this.sessions[transactionID]) {
|
|
return;
|
|
}
|
|
const session = this.sessions[transactionID];
|
|
// Delete from registry FIRST to prevent race conditions
|
|
// This ensures other operations can't retrieve this session while we're ending it
|
|
delete this.sessions[transactionID];
|
|
// end the session promise in failure by calling reject
|
|
await session.reject();
|
|
};
|
|
|
|
//# sourceMappingURL=rollbackTransaction.js.map |