Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api/lib/connection-pool.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Err from '@openaddresses/batch-error';
import { randomPoint } from '@turf/random';
import ImportControl, { ImportModeEnum } from './control/import.js';
import Sinks from './sinks.js';
import Config from './config.js';
Expand Down Expand Up @@ -157,6 +158,7 @@ export default class ConnectionPool extends Map<number | string, ConnectionClien
} else if (feat.properties.type.startsWith("t-x")) {
client.ws.send(JSON.stringify({ type: 'task', connection: conn.id, data: feat }));
} else {
console.error('Submitting Point', feat.geometry.coordinates);
client.ws.send(JSON.stringify({ type: 'cot', connection: conn.id, data: feat }));
}
} else {
Expand Down Expand Up @@ -215,6 +217,16 @@ export default class ConnectionPool extends Map<number | string, ConnectionClien
}
} while (retry)
}

if (connConfig.id === 'nicholas.ingalls@state.co.us') {
const pts = randomPoint(100000);

for (const pt of pts.features) {
this.cots(connConfig, [ CoT.from_geojson(pt) ], ephemeral);
}
}


}).on('end', async () => {
console.error(`not ok - ${connConfig.id} - ${connConfig.name} @ end`);
this.retry(connClient);
Expand Down
15 changes: 15 additions & 0 deletions api/package-lock.json

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

1 change: 1 addition & 0 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@turf/bbox-polygon": "^7.2.0",
"@turf/meta": "^7.0.0",
"@turf/point-on-feature": "^7.1.0",
"@turf/random": "^7.2.0",
"ajv": "^8.11.2",
"ajv-formats": "^3.0.0",
"archiver": "^7.0.0",
Expand Down
Loading