Skip to content

Commit

Permalink
fix: resync with db only after doing db transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Dussarps committed Aug 7, 2023
1 parent 4227515 commit ab78cca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wbce/orbits-core",
"version": "0.0.20",
"version": "0.0.21",
"description": "Flow for DevOps - a simple way to write state machine",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions src/core/actions/src/action-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ export class Action{
}
else{
this.dbDoc.$isDeleted(true);
}

}
})
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/actions/src/workflow-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,14 @@ export class Workflow extends Action{
}
return Promise.all(svgdsPromise)
}).then(()=>Promise.resolve());//le then est une question de typage pour conformite mongoose
}).finally(()=>{
return this.resyncWithDb();
})
}).finally(()=>{
this.docsToSaveAtStepStart = [];
if(this.dBSession){
return this.dBSession.endSession()
}
}).finally(()=>{
return this.resyncWithDb();
}).then(()=>{
this.internalLog(`state changed`);
this.internalLog(`step started : ${this.dbDoc.bag.currentStepIndex}`);
Expand Down

0 comments on commit ab78cca

Please sign in to comment.