diff --git a/lib/stoptimes/StopTimes2Cxs.js b/lib/stoptimes/StopTimes2Cxs.js index ed19a86..3d50d91 100644 --- a/lib/stoptimes/StopTimes2Cxs.js +++ b/lib/stoptimes/StopTimes2Cxs.js @@ -53,18 +53,20 @@ module.exports = function (sourcePath, outPath, stores, fresh) { printedRows++; }); - connectionRules.on('end', () => { + connectionRules.on('end', async () => { for (let i in connectionsPool) { connectionsPool[i].end(); } // Close all LevelDB stores as they will not be used any further on this process if (!(stores.stopsDB instanceof Map)) { - stores.stopsDB.close(); - stores.tripsDB.close(); - stores.routesDB.close(); - stores.servicesDB.close(); - historyDB.close(); + await Promise.all([ + stores.stopsDB.close(), + stores.tripsDB.close(), + stores.routesDB.close(), + stores.servicesDB.close(), + historyDB.close() + ]); } console.error(`Created ${printedRows} Connection rules in ${new Date() - t0} ms`); diff --git a/lib/stoptimes/st2c.js b/lib/stoptimes/st2c.js index 66296ad..a991be5 100644 --- a/lib/stoptimes/st2c.js +++ b/lib/stoptimes/st2c.js @@ -128,11 +128,7 @@ // Update history with new found service dates const update = Object.assign({}, old); newServices.forEach(nsd => { - update[nsd] = { - type: 'Connection', - departureDelay: 0, - arrivalDelay: 0 - } + update[nsd] = { type: 'Connection' }; }); await this.historyDB.put(id, update); diff --git a/package-lock.json b/package-lock.json index 4faa6f7..d73c811 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gtfs2lc", - "version": "2.1.3", + "version": "2.1.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gtfs2lc", - "version": "2.1.3", + "version": "2.1.4", "license": "MIT", "dependencies": { "commander": "^4.1.1", diff --git a/package.json b/package.json index fc2cbd8..b81bfe9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gtfs2lc", - "version": "2.1.3", + "version": "2.1.4", "description": "Mapping script from gtfs to (linked) connections", "main": "lib/gtfs2lc.js", "bin": {