mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
chore: clear listener after transaction commited (#4879)
This commit is contained in:
parent
954e9304d9
commit
7542f12445
@ -27,6 +27,17 @@ export function transactionWrapperBuilder(transactionGenerator) {
|
|||||||
newTransaction = true;
|
newTransaction = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transaction.afterCommit(() => {
|
||||||
|
if (transaction.eventCleanupBinded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
transaction.eventCleanupBinded = true;
|
||||||
|
if (this.database) {
|
||||||
|
this.database.removeAllListeners(`transactionRollback:${transaction.id}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 需要将 newTransaction 注入到被装饰函数参数内
|
// 需要将 newTransaction 注入到被装饰函数参数内
|
||||||
if (newTransaction) {
|
if (newTransaction) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user