MCPcopy Create free account
hub / github.com/acoyfellow/cloudbox / queue

Function queue

scripts/cloudbox-live-sync.mjs:52–62  ·  view source on GitHub ↗
(_event, filename)

Source from the content-addressed store, hash-verified

50}
51
52function queue(_event, filename) {
53 if (!filename) return;
54 const fullPath = resolve(root, String(filename));
55 const remotePath = toRemotePath(fullPath);
56 if (!remotePath || isIgnored(remotePath)) return;
57 clearTimeout(pending.get(remotePath));
58 pending.set(remotePath, setTimeout(() => {
59 pending.delete(remotePath);
60 sync(fullPath, remotePath).catch((error) => console.error(`sync error ${remotePath} ${message(error)}`));
61 }, debounceMs));
62}
63
64function toRemotePath(fullPath) {
65 const localPath = relative(root, fullPath);

Callers

nothing calls this directly

Calls 6

toRemotePathFunction · 0.85
isIgnoredFunction · 0.85
syncFunction · 0.85
getMethod · 0.80
deleteMethod · 0.80
messageFunction · 0.70

Tested by

no test coverage detected