MCPcopy Create free account
hub / github.com/cloudflare/computer / #pullResolved

Method #pullResolved

packages/computer/src/workspace.ts:640–661  ·  view source on GitHub ↗
(resolvedId: string | undefined)

Source from the content-addressed store, hash-verified

638 }
639
640 #pullResolved(resolvedId: string | undefined): Promise<ApplyResult> {
641 return withSpan(
642 this.#observer,
643 "workspace.sync.pull",
644 { "workspace.sync.backend": resolvedId },
645 async () => {
646 if (resolvedId === undefined || this.#moduleBackendsById.has(resolvedId)) {
647 return { applied: 0, skipped: [] };
648 }
649 const handle = await this.#handleFor(resolvedId);
650 if (handle.sync === "none") return { applied: 0, skipped: [] };
651 return this.#runWithInvalidation(resolvedId, handle, () =>
652 pullOnce(this.#db, handle.rpc.sync, resolvedId),
653 );
654 },
655 (span, outcome) => {
656 if (!outcome.ok) return;
657 span.setAttribute("workspace.sync.applied", outcome.value.applied);
658 span.setAttribute("workspace.sync.skipped", outcome.value.skipped.length);
659 },
660 );
661 }
662
663 async #schedulePendingSync(id: string): Promise<void> {
664 const scheduler = this.#retryScheduler;

Callers 2

pullMethod · 0.95
retryPendingSyncMethod · 0.95

Calls 6

#handleForMethod · 0.95
#runWithInvalidationMethod · 0.95
pullOnceFunction · 0.90
withSpanFunction · 0.85
hasMethod · 0.80
setAttributeMethod · 0.65

Tested by

no test coverage detected