mirror of
https://github.com/danbulant/sql2csv
synced 2026-06-19 06:21:25 +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 = "." + loc;//fix for empty location
|
||||||
loc += ".csv";
|
loc += ".csv";
|
||||||
fs.writeFile(loc, result.csv, { flag: "w"}, (err)=>{if(err)error(err)});
|
fs.writeFile(loc, result.csv, { flag: "w"}, (err)=>{
|
||||||
success(`Task from file ${file} done in ` + Math.round(result.end - result.start) + "ms, saved to "+loc);
|
if(err) error(err);
|
||||||
running.a--;
|
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)});
|
.catch(err => {error(err); process.exit(0)});
|
||||||
running.registerListener(function(val) {
|
running.registerListener(function(val) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue