It's a Context Transaction (ctxn) now
This commit is contained in:
parent
7645fe6b23
commit
c888b1f401
1 changed files with 4 additions and 4 deletions
|
@ -80,12 +80,12 @@ export abstract class GenericEchoChamber<C extends EchoContext, K, V> extends Ev
|
||||||
this.cache.get(key).txn.cancel();
|
this.cache.get(key).txn.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
const txn = this.context.beginTransaction(auditName, runFn);
|
const ctxn = this.context.beginTransaction(auditName, runFn);
|
||||||
this.cacheVal(key, targetVal, txn); // set the cache now as it won't be updated by the .when() ladder below.
|
this.cacheVal(key, targetVal, ctxn); // set the cache now as it won't be updated by the .when() ladder below.
|
||||||
|
|
||||||
txn.when(TransactionStatus.Pending, () => this.cacheVal(key, targetVal, txn))
|
ctxn.when(TransactionStatus.Pending, () => this.cacheVal(key, targetVal, ctxn))
|
||||||
.when(TransactionStatus.Error, () => revertFn());
|
.when(TransactionStatus.Error, () => revertFn());
|
||||||
|
|
||||||
txn.run();
|
ctxn.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue