Skip to content

Commit 67be113

Browse files
authored
Merge pull request #1422 from ahoppen/log-park-expired
Log when the 10 year wait that’s parking the main thread expires for some reason
2 parents 0f55306 + cf48252 commit 67be113

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/sourcekit-lsp/SourceKitLSP.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ struct SourceKitLSP: AsyncParsableCommand {
274274
// Park the main function by sleeping for 10 years.
275275
// All request handling is done on other threads and sourcekit-lsp exits by calling `_Exit` when it receives a
276276
// shutdown notification.
277-
try await Task.sleep(for: .seconds(60 * 60 * 24 * 365 * 10))
277+
while true {
278+
try? await Task.sleep(for: .seconds(60 * 60 * 24 * 365 * 10))
279+
logger.fault("10 year wait that's parking the main thread expired. Waiting again.")
280+
}
278281
}
279282
}
280283

0 commit comments

Comments
 (0)