Skip to content
Merged
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
9 changes: 4 additions & 5 deletions src/service/extract-load-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,16 @@ export class ExtractLoadService {
const promises = [];
console.time(`processFiles ${tdei_dataset_id}`);
for await (const entry of directory) {
if (entry.type === 'File' && entry.path.endsWith('.geojson')) {
if (entry.type === 'File' && entry.path.endsWith('.geojson') && !entry.path.includes('__MACOSX/')) {
const content = await entry.buffer();
let jsonData;
try {
jsonData = JSON.parse(content.toString('utf8'));
} catch (error) {
console.error("Unable to parse content as JSON:", content.toString('utf8'));
continue;
console.error("Unable to parse content as JSON:", entry.path, error);
throw new Error("Unable to parse content as JSON:" + entry.path + error);
}

if (entry.path.includes('nodes')) {
promises.push(this.bulkInsertNodes(client, tdei_dataset_id, user_id, jsonData));
} else if (entry.path.includes('edges')) {
Expand All @@ -117,8 +118,6 @@ export class ExtractLoadService {
promises.push(this.bulkInsertExtension(client, tdei_dataset_id, user_id, jsonData, entry));
}

} else {
entry.autodrain();
}
}
await Promise.all(promises);
Expand Down
Loading