Changesets · Branches · Tags · Compare
| Changeset | 5d6825a019b3e68a5b5efb6feebf25daf94279e870c28c03495420baf26efd07 |
|---|---|
| Author | Jakub Blach <jakubblach@gmail.com> · 2025-07-08 16:53 +02:00 |
| Committer | Jakub Blach <jakubblach@gmail.com> · 2025-07-08 16:53 +02:00 |
| Parents | 95206ce5cf3c |
2 files changed
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessengerManager.kt +12 −8
| @@ -7,6 +7,8 @@ | ||
| 7 | 7 | import com.intellij.openapi.diagnostic.Logger |
| 8 | 8 | import com.intellij.openapi.project.Project |
| 9 | 9 | import kotlinx.coroutines.CoroutineScope |
| 10 | +import kotlinx.coroutines.delay | |
| 11 | +import kotlinx.coroutines.launch | |
| 10 | 12 | |
| 11 | 13 | class CoreMessengerManager( |
| 12 | 14 | private val project: Project, |
| @@ -22,14 +24,16 @@ | ||
| 22 | 24 | } |
| 23 | 25 | |
| 24 | 26 | fun restart() { |
| 25 | - try { | |
| 26 | - coreMessenger.killSubProcess() | |
| 27 | - lastBackoffInterval *= 2 | |
| 28 | - log.warn("Continue process exited, retrying in $lastBackoffInterval seconds") | |
| 29 | - Thread.sleep((lastBackoffInterval * 1000).toLong()) | |
| 30 | - coreMessenger = createCoreMessenger() | |
| 31 | - } catch (e: Exception) { | |
| 32 | - service<TelemetryService>().capture("jetbrains_core_start_error", mapOf("error" to e)) | |
| 27 | + coroutineScope.launch { | |
| 28 | + try { | |
| 29 | + coreMessenger.killSubProcess() | |
| 30 | + lastBackoffInterval *= 2 | |
| 31 | + log.warn("Continue process exited, retrying in $lastBackoffInterval seconds") | |
| 32 | + delay((lastBackoffInterval * 1000).toLong()) | |
| 33 | + coreMessenger = createCoreMessenger() | |
| 34 | + } catch (e: Exception) { | |
| 35 | + service<TelemetryService>().capture("jetbrains_core_start_error", mapOf("error" to e)) | |
| 36 | + } | |
| 33 | 37 | } |
| 34 | 38 | } |
| 35 | 39 |
modified extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/ContinueProcessHandlerTest.kt +2 −2
| @@ -23,7 +23,7 @@ | ||
| 23 | 23 | |
| 24 | 24 | handler.close() |
| 25 | 25 | |
| 26 | - // assert all message lines are present (order not important) | |
| 26 | + // assert all message lines are present (order is not important) | |
| 27 | 27 | val lines = process.string.split("\r\n").filter { it.isNotBlank() } |
| 28 | 28 | for (i in 0..100) |
| 29 | 29 | Assertions.assertTrue(lines.contains("message number $i")) |
| @@ -48,4 +48,4 @@ | ||
| 48 | 48 | override fun close() { |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | -} | |
| No newline at the end of the file | ||
| 51 | +} |