Skip to content

Commit

Permalink
remove callback to save template file
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Sergeev committed Feb 23, 2024
1 parent 8654229 commit f6fcecc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/test/StatedWorkflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,4 @@ test("subscribePulsar with pulsarMock client", async () => {

expect(tp.output.interceptedMessages?.length).toBeGreaterThanOrEqual(2)
expect(tp.output.farFarAway?.length + tp.output.nearBy?.length).toEqual(2);

PulsarClientMock.inMemoryStore

})
7 changes: 4 additions & 3 deletions src/workflow/StatedWorkflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,12 @@ export class StatedWorkflow {
resolve = _resolve; //we assign our resolve variable that is declared outside this promise so that our onDataChange callbacks can use it
});

// TODO: switch to pass acknowledgement callback to dispatch
this.templateProcessor.setDataChangeCallback('/', async (data, jsonPtrs, removed) => {
for (let jsonPtr of jsonPtrs) {
if (/^\/step\d+\/log\/.*$/.test(jsonPtr)) {
fs.writeFileSync(path.join(basePath,'template.json') , StatedREPL.stringify(data), 'utf8');
}
// if (/^\/step\d+\/log\/.*$/.test(jsonPtr)) {
// fs.writeFileSync(path.join(basePath,'template.json') , StatedREPL.stringify(data), 'utf8');
// }
if (/^\/step1\/log\/.*$/.test(jsonPtr)) {
// TODO: await persist the step
const dataThatChanged = jp.get(data, jsonPtr);
Expand Down

0 comments on commit f6fcecc

Please sign in to comment.