Skip to content

Commit

Permalink
Changed blotter write to async
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto49er authored and askmike committed Apr 16, 2019
1 parent 5d36ee0 commit 18f05b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 0 additions & 4 deletions plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ var plugins = [
slug: 'blotter',
async: false,
modes: ['realtime'],
dependencies: [{
module: 'fs',
version: '0.0.1-security'
}]
},
];

Expand Down
8 changes: 7 additions & 1 deletion plugins/blotter.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ Blotter.prototype.processTradeCompleted = function(trade) {
log.error('Received 1969/1970 error, trade failed to execute, did not record in blotter');
}
else {
fsw.appendFileSync(this.filename, this.outtxt, encoding='utf8');

fsw.appendFile(this.filename, this.outtxt, 'utf8', (err) => {
if(err) {
log.error('Unable to write trade to blotter');
}
});

}
this.outtxt = "";

Expand Down

0 comments on commit 18f05b5

Please sign in to comment.