Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

Commit

Permalink
fix: delay sending diagnotics request
Browse files Browse the repository at this point in the history
It seems that it halts checker for some time and it cannot answer
another requests.
  • Loading branch information
s-panferov committed Aug 14, 2017
1 parent 5304203 commit 90022ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/checker/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class Checker {
} as RemoveFile.Request);
}

getDiagnostics(): any {
getDiagnostics(): Promise<any> {
return this.req({
type: 'Diagnostics'
} as Diagnostics.Request);
Expand Down
6 changes: 3 additions & 3 deletions src/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ function setupAfterCompile(compiler, instanceName, forkChecker = false) {
});

const timeStart = +(new Date());
const diag = instance.loaderConfig.transpileOnly
const diag = () => instance.loaderConfig.transpileOnly
? Promise.resolve()
: instance.checker.getDiagnostics()
.then(diags => {
Expand All @@ -479,10 +479,10 @@ function setupAfterCompile(compiler, instanceName, forkChecker = false) {
files
.then(() => {
if (asyncErrors) {
// Don't wait for diags in watch mode
diag(); // Don't wait for diags in watch mode
return;
} else {
return diag;
return diag();
}
})
.then(() => callback())
Expand Down

0 comments on commit 90022ae

Please sign in to comment.