Skip to content

Commit 86c076b

Browse files
committed
Update retry interval
1 parent 4dd291e commit 86c076b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Tool/Sources/GitHubCopilotService/LanguageServer/GitHubCopilotService.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,14 @@ public final class GitHubCopilotService: GitHubCopilotBaseService,
396396
} catch let error as ServerError {
397397
switch error {
398398
case .serverError:
399+
// sometimes the content inside language server is not new enough, which can
400+
// lead to an version mismatch error. We can try a few times until the content
401+
// is up to date.
399402
if maxTry <= 0 { break }
400403
Logger.gitHubCopilot.error(
401404
"Try getting suggestions again: \(GitHubCopilotError.languageServerError(error).localizedDescription)"
402405
)
403-
try await Task.sleep(nanoseconds: 400_000_000)
406+
try await Task.sleep(nanoseconds: 200_000_000)
404407
return try await sendRequest(maxTry: maxTry - 1)
405408
default:
406409
break

0 commit comments

Comments
 (0)