(fileName, callback, defaultPollingInterval)
| 6257 | var highPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.High); |
| 6258 | return watchFile; |
| 6259 | function watchFile(fileName, callback, defaultPollingInterval) { |
| 6260 | var file = { |
| 6261 | fileName: fileName, |
| 6262 | callback: callback, |
| 6263 | unchangedPolls: 0, |
| 6264 | mtime: getModifiedTime(host, fileName) |
| 6265 | }; |
| 6266 | watchedFiles.push(file); |
| 6267 | addToPollingIntervalQueue(file, defaultPollingInterval); |
| 6268 | return { |
| 6269 | close: function () { |
| 6270 | file.isClosed = true; |
| 6271 | // Remove from watchedFiles |
| 6272 | ts.unorderedRemoveItem(watchedFiles, file); |
| 6273 | // Do not update polling interval queue since that will happen as part of polling |
| 6274 | } |
| 6275 | }; |
| 6276 | } |
| 6277 | function createPollingIntervalQueue(pollingInterval) { |
| 6278 | var queue = []; |
| 6279 | queue.pollingInterval = pollingInterval; |
no test coverage detected