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

Function onWatchFileStat

test/fixtures/snapshot/typescript.js:6308–6331  ·  view source on GitHub ↗
(watchedFile, pollIndex, fileChanged)

Source from the content-addressed store, hash-verified

6306 function pollQueue(queue, pollingInterval, pollIndex, chunkSize) {
6307 return pollWatchedFileQueue(host, queue, pollIndex, chunkSize, onWatchFileStat);
6308 function onWatchFileStat(watchedFile, pollIndex, fileChanged) {
6309 if (fileChanged) {
6310 watchedFile.unchangedPolls = 0;
6311 // Changed files go to changedFilesInLastPoll queue
6312 if (queue !== changedFilesInLastPoll) {
6313 queue[pollIndex] = undefined;
6314 addChangedFileToLowPollingIntervalQueue(watchedFile);
6315 }
6316 }
6317 else if (watchedFile.unchangedPolls !== ts.unchangedPollThresholds[pollingInterval]) {
6318 watchedFile.unchangedPolls++;
6319 }
6320 else if (queue === changedFilesInLastPoll) {
6321 // Restart unchangedPollCount for unchanged file and move to low polling interval queue
6322 watchedFile.unchangedPolls = 1;
6323 queue[pollIndex] = undefined;
6324 addToPollingIntervalQueue(watchedFile, PollingInterval.Low);
6325 }
6326 else if (pollingInterval !== PollingInterval.High) {
6327 watchedFile.unchangedPolls++;
6328 queue[pollIndex] = undefined;
6329 addToPollingIntervalQueue(watchedFile, pollingInterval === PollingInterval.Low ? PollingInterval.Medium : PollingInterval.High);
6330 }
6331 }
6332 }
6333 function pollingIntervalQueue(pollingInterval) {
6334 switch (pollingInterval) {

Callers

nothing calls this directly

Tested by

no test coverage detected