MCPcopy Index your code
hub / github.com/TanStack/db / process

Method process

packages/db/src/collection/cleanup-queue.ts:75–92  ·  view source on GitHub ↗

* Runs every task whose deadline has passed, then schedules the next wakeup * if there is still pending work.

()

Source from the content-addressed store, hash-verified

73 * if there is still pending work.
74 */
75 private process(): void {
76 this.timeoutId = null
77 const now = Date.now()
78 for (const [key, task] of this.tasks.entries()) {
79 if (now >= task.executeAt) {
80 this.tasks.delete(key)
81 try {
82 task.callback()
83 } catch (error) {
84 console.error('Error in CleanupQueue task:', error)
85 }
86 }
87 }
88
89 if (this.tasks.size > 0) {
90 this.updateTimeout()
91 }
92 }
93
94 /**
95 * Resets the singleton instance for tests.

Callers 1

updateTimeoutMethod · 0.95

Calls 3

updateTimeoutMethod · 0.95
entriesMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected