MCPcopy Index your code
hub / github.com/codeaashu/claude-code / stopTeamMemoryWatcher

Function stopTeamMemoryWatcher

src/services/teamMemorySync/watcher.ts:327–352  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

325 * process.exit() will kill it.
326 */
327export async function stopTeamMemoryWatcher(): Promise<void> {
328 if (debounceTimer) {
329 clearTimeout(debounceTimer)
330 debounceTimer = null
331 }
332 if (watcher) {
333 watcher.close()
334 watcher = null
335 }
336 // Await any in-flight push
337 if (currentPushPromise) {
338 try {
339 await currentPushPromise
340 } catch {
341 // Ignore errors during shutdown
342 }
343 }
344 // Flush pending changes that were debounced but not yet pushed
345 if (hasPendingChanges && syncState && pushSuppressedReason === null) {
346 try {
347 await pushTeamMemory(syncState)
348 } catch {
349 // Best-effort — shutdown may kill this
350 }
351 }
352}
353
354/**
355 * Test-only: reset module state and optionally seed syncState.

Callers 1

startFileWatcherFunction · 0.85

Calls 2

pushTeamMemoryFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected