diff options
-rwxr-xr-x | create-data.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/create-data.js b/create-data.js index 1e62d2d..0c9a76f 100755 --- a/create-data.js +++ b/create-data.js @@ -29,7 +29,7 @@ pgql.connect('tcp://' + config.user + ':' + config.password + '@' + config.server + ':' + config.port + '/' + - config.database, function(err, client) { + config.database, function(err, client, done) { if (err) { console.error(err); return; @@ -145,11 +145,12 @@ pgql.connect('tcp://' + config.user + ':' + function(err, collections){ if (err) { console.error(err); + console.error("Failed to create data.json"); process.exit(1); } console.info("ending database connection"); - pgql.end(); + done(); writeDataFiles(collections, function() { Object.keys(validationByURI).sort().forEach(function(uri) { |