MCPcopy Index your code
hub / github.com/nodejs/node / onTimerToUpdateChildWatches

Function onTimerToUpdateChildWatches

test/fixtures/snapshot/typescript.js:6638–6670  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6636 timerToUpdateChildWatches = setTimeout(onTimerToUpdateChildWatches, 1000);
6637 }
6638 function onTimerToUpdateChildWatches() {
6639 timerToUpdateChildWatches = undefined;
6640 sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
6641 var start = ts.timestamp();
6642 var invokeMap = new ts.Map();
6643 while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
6644 var result = cacheToUpdateChildWatches.entries().next();
6645 ts.Debug.assert(!result.done);
6646 var _a = result.value, dirPath = _a[0], _b = _a[1], dirName = _b.dirName, options = _b.options, fileNames = _b.fileNames;
6647 cacheToUpdateChildWatches.delete(dirPath);
6648 // Because the child refresh is fresh, we would need to invalidate whole root directory being watched
6649 // to ensure that all the changes are reflected at this time
6650 var hasChanges = updateChildWatches(dirName, dirPath, options);
6651 invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
6652 }
6653 sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
6654 callbackCache.forEach(function (callbacks, rootDirName) {
6655 var existing = invokeMap.get(rootDirName);
6656 if (existing) {
6657 callbacks.forEach(function (_a) {
6658 var callback = _a.callback, dirName = _a.dirName;
6659 if (ts.isArray(existing)) {
6660 existing.forEach(callback);
6661 }
6662 else {
6663 callback(dirName);
6664 }
6665 });
6666 }
6667 });
6668 var elapsed = ts.timestamp() - start;
6669 sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
6670 }
6671 function removeChildWatches(parentWatcher) {
6672 if (!parentWatcher)
6673 return;

Callers

nothing calls this directly

Calls 11

sysLogFunction · 0.85
updateChildWatchesFunction · 0.85
invokeCallbacksFunction · 0.85
concatMethod · 0.80
assertMethod · 0.80
callbackFunction · 0.70
nextMethod · 0.65
deleteMethod · 0.65
forEachMethod · 0.65
getMethod · 0.65
entriesMethod · 0.45

Tested by

no test coverage detected