MCPcopy Create free account
hub / github.com/massCodeIO/massCode / flushContentUpdate

Function flushContentUpdate

src/renderer/composables/useSnippetUpdate.ts:45–67  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

43}
44
45async function flushContentUpdate(key: string) {
46 const update = updateContentQueue.value.get(key)
47 if (!update) {
48 return
49 }
50
51 updateContentQueue.value.delete(key)
52 inFlightContentKeys.value.add(key)
53
54 try {
55 await updateSnippetContent(update.snippetId, update.contentId, update.data)
56 }
57 catch (error) {
58 console.error(error)
59 }
60 finally {
61 inFlightContentKeys.value.delete(key)
62
63 if (updateContentQueue.value.has(key)) {
64 scheduleContentUpdate(key)
65 }
66 }
67}
68
69function scheduleContentUpdate(key: string) {
70 const pendingTimer = contentUpdateTimers.value.get(key)

Callers 1

scheduleContentUpdateFunction · 0.70

Calls 3

updateSnippetContentFunction · 0.85
scheduleContentUpdateFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected