Skip to content

Commit

Permalink
Merge pull request #145 from linkedconnections/development
Browse files Browse the repository at this point in the history
v2.2.0
  • Loading branch information
julianrojas87 committed Jan 28, 2023
2 parents c387e69 + b591d37 commit 0e9193c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bin/gtfs2lc-clean.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
12 changes: 6 additions & 6 deletions lib/gtfs2connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ Mapper.prototype.resultStream = async function (path, output, done) {
instance: i,
output,
options: this._options
},
resourceLimits: {
maxOldGenerationSizeMb: 12000
}
});

Expand Down Expand Up @@ -95,7 +92,7 @@ Mapper.prototype.resultStream = async function (path, output, done) {

try {
console.error('Merging final Linked Connections file...');
if(this._options.compressed) {
if (this._options.compressed) {
mergeCommand = 'cat';
gz = '.gz';
}
Expand Down Expand Up @@ -167,8 +164,11 @@ async function removePrefixes(output) {
if (!isMainThread) {
let fmt = 'json';
// Read the connection rules file created in the master thread and build the Connection objects!
let connectionStream = fs.createReadStream(workerData['output'] + '/connections_' + workerData['instance'] + '.txt', { encoding: 'utf8', objectMode: true })
.pipe(JSONLParser())
// Use a low highWaterMark to prevent backpressure memory leaks given that this is an inflating pipeline.
let connectionStream = fs.createReadStream(
`${workerData['output']}/connections_${workerData['instance']}.txt`,
{ encoding: 'utf8', objectMode: true, highWaterMark: 4 * 1024 }
).pipe(JSONLParser())
.pipe(new ConnectionsBuilder())
.on('error', function (e) {
console.error(e);
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e9193c

Please sign in to comment.