Skip to content

Commit beb4018

Browse files
authored
fix: remove watchers for inferred projects (#63)
Inferred projects are not used by the angular language service and the watchers were causing 100% CPU usage in some cases.
1 parent e11ebbe commit beb4018

File tree

3 files changed

+5
-22
lines changed

3 files changed

+5
-22
lines changed

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
language: node_js
22
sudo: false
33

4-
before_install:
5-
- curl -o- -L https://yarnpkg.com/install.sh | bash
6-
- export PATH=$HOME/.yarn/bin:$PATH
7-
84
node_js:
9-
- '6.6.0'
5+
- '6.9'
106

117
env:
128
matrix:

server/src/editorServices.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,23 +1230,6 @@ export class ProjectService {
12301230
const project = new Project(this, this.psLogger);
12311231
project.addRoot(root);
12321232

1233-
let currentPath = getDirectoryPath(root.fileName);
1234-
let parentPath = getDirectoryPath(currentPath);
1235-
while (currentPath != parentPath) {
1236-
if (!project.projectService.directoryWatchersForTsconfig[currentPath]) {
1237-
this.log("Add watcher for: " + currentPath);
1238-
project.projectService.directoryWatchersForTsconfig[currentPath] =
1239-
this.host.watchDirectory(currentPath, fileName => this.directoryWatchedForTsconfigChanged(fileName));
1240-
project.projectService.directoryWatchersRefCount[currentPath] = 1;
1241-
}
1242-
else {
1243-
project.projectService.directoryWatchersRefCount[currentPath] += 1;
1244-
}
1245-
project.directoriesWatchedForTsconfig.push(currentPath);
1246-
currentPath = parentPath;
1247-
parentPath = getDirectoryPath(parentPath);
1248-
}
1249-
12501233
project.finishGraph();
12511234
this.inferredProjects.push(project);
12521235
return project;

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+

0 commit comments

Comments
 (0)