MCPcopy
hub / github.com/opentrace/opentrace / drainRelsToStore

Method drainRelsToStore

ui/src/job/browserJobService.ts:512–528  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

510
511 /** Drain buffered relationships from the store stage and persist them. */
512 const drainRelsToStore = async () => {
513 const rels = storeStage!.drainRelationships();
514 if (rels.length === 0) return;
515 debug.log('store', `draining ${rels.length} rels`);
516 await this.store.importBatch({
517 nodes: [],
518 relationships: rels.map((r) => ({
519 id: r.id,
520 type: r.type,
521 source_id: r.source_id,
522 target_id: r.target_id,
523 properties: r.properties,
524 })),
525 });
526 await this.store.flush();
527 persistedRels += rels.length;
528 };
529
530 for (const event of concurrentPipeline) {
531 if (cancelled) break;

Callers

nothing calls this directly

Calls 4

drainRelationshipsMethod · 0.80
logMethod · 0.80
importBatchMethod · 0.65
flushMethod · 0.65

Tested by

no test coverage detected