Skip to content

Commit

Permalink
Add a timeout to waitForInitializeJobs() (eclipse-jdtls#1773)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored May 18, 2021
1 parent 9b71f1c commit c65e7ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ public static void waitForBuildJobs(int maxTimeMilis) {
}

public static void waitForInitializeJobs() {
waitForJobs(InitializeJobMatcher.INSTANCE, MAX_TIME_MILLIS);
waitForInitializeJobs(MAX_TIME_MILLIS);
}

public static void waitForInitializeJobs(int maxTimeMillis) {
waitForJobs(InitializeJobMatcher.INSTANCE, maxTimeMillis);
}

public static void waitForDownloadSourcesJobs(int maxTimeMillis) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
public void initialized(InitializedParams params) {
logInfo(">> initialized");
try {
JobHelpers.waitForInitializeJobs();
JobHelpers.waitForInitializeJobs(60 * 60 * 1000); // 1 hour
} catch (OperationCanceledException e) {
logException(e.getMessage(), e);
}
Expand Down

0 comments on commit c65e7ea

Please sign in to comment.