MCPcopy
hub / github.com/coder/mux / shouldFetchWorkspace

Method shouldFetchWorkspace

src/browser/stores/PRStatusStore.ts:580–591  ·  view source on GitHub ↗
(entry: WorkspacePRCacheEntry | undefined, now: number)

Source from the content-addressed store, hash-verified

578 }
579
580 private shouldFetchWorkspace(entry: WorkspacePRCacheEntry | undefined, now: number): boolean {
581 if (!entry) return true;
582 // Allow refresh if entry was hydrated from localStorage (fetchedAt === 0)
583 // but is marked loading - this means we have stale cached data and need fresh data.
584 if (entry.loading && entry.fetchedAt !== 0) return false;
585
586 if (entry.error) {
587 return now - entry.fetchedAt > ERROR_RETRY_DELAY_MS;
588 }
589
590 return now - entry.fetchedAt > STATUS_CACHE_TTL_MS;
591 }
592
593 /**
594 * Refresh PR status for all subscribed workspaces.

Callers 1

refreshAllMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected