Permalink
Browse files

fix(unitofwork): only run process after commit after the scope is clean

  • Loading branch information...
edouardmenayde committed Sep 26, 2017
1 parent 52db76f commit b12fda79ccade98a1fe75cdd6deac5b1604c604e
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/UnitOfWork.ts
@@ -563,10 +563,10 @@ export class UnitOfWork {
.then(() => this.deleteDeleted(skipLifecycleHooks))
.then(() => this.updateRelationships())
.then(() => this.commitOrRollback(true))
.then(() => this.processAfterCommit())
.then(() => this.entityManager.getConfig().fetch('entityManager.refreshUpdated') && this.refreshDirty())
.then(() => this.entityManager.getConfig().fetch('entityManager.refreshCreated') && this.refreshNew())
.then(() => !skipClean && this.clean())
.then(() => !skipClean && this.processAfterCommit())
.catch(error => this.commitOrRollback(false, error));
}

0 comments on commit b12fda7

Please sign in to comment.