mirror of
https://github.com/danbulant/sql2csv
synced 2026-05-19 04:18:33 +00:00
Fix premature process exit
This commit is contained in:
parent
6a9f01824d
commit
8dd2e5ffc6
1 changed files with 5 additions and 3 deletions
8
index.js
8
index.js
|
|
@ -131,9 +131,11 @@ con.connect(function(err) {
|
|||
}
|
||||
loc = "." + loc;//fix for empty location
|
||||
loc += ".csv";
|
||||
fs.writeFile(loc, result.csv, { flag: "w"}, (err)=>{if(err)error(err)});
|
||||
success(`Task from file ${file} done in ` + Math.round(result.end - result.start) + "ms, saved to "+loc);
|
||||
running.a--;
|
||||
fs.writeFile(loc, result.csv, { flag: "w"}, (err)=>{
|
||||
if(err) error(err);
|
||||
success(`Task from file ${file} done in ` + Math.round(result.end - result.start) + "ms, saved to "+loc);
|
||||
running.a--;
|
||||
});
|
||||
})
|
||||
.catch(err => {error(err); process.exit(0)});
|
||||
running.registerListener(function(val) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue