Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: partially revert previous comment
Seems like we can't properly get the coroutine name from a Job.
The name of the coroutine is not super friendly but still workable with
the new logs.
  • Loading branch information
fioan89 committed Sep 12, 2025
commit 3997712960ea7fa1d12669fc64f05ef91007dec2
12 changes: 5 additions & 7 deletions src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import com.coder.toolbox.sdk.ex.APIResponseException
import com.coder.toolbox.sdk.v2.models.WorkspaceStatus
import com.coder.toolbox.util.CoderProtocolHandler
import com.coder.toolbox.util.DialogUi
import com.coder.toolbox.util.friendlyName
import com.coder.toolbox.util.name
import com.coder.toolbox.util.toURL
import com.coder.toolbox.util.waitForTrue
import com.coder.toolbox.util.withPath
Expand Down Expand Up @@ -91,7 +89,7 @@ class CoderRemoteProvider(
* first time).
*/
private fun poll(client: CoderRestClient, cli: CoderCLIManager): Job =
context.cs.launch(CoroutineName("Workspace Poller - ${friendlyName()}")) {
context.cs.launch(CoroutineName("Workspace Poller")) {
var lastPollTime = TimeSource.Monotonic.markNow()
while (isActive) {
try {
Expand Down Expand Up @@ -246,7 +244,7 @@ class CoderRemoteProvider(
override fun close() {
pollJob?.let {
it.cancel()
context.logger.info("Cancelled workspace poll job ${pollJob.name()}")
context.logger.info("Cancelled workspace poll job ${pollJob.toString()}")
}
client?.close()
lastEnvironments.clear()
Expand Down Expand Up @@ -332,7 +330,7 @@ class CoderRemoteProvider(

environments.showLoadingMessage()
pollJob = poll(restClient, cli)
context.logger.info("Workspace poll job with name ${pollJob.name()} was created while handling URI $uri")
context.logger.info("Workspace poll job with name ${pollJob.toString()} was created while handling URI $uri")
isInitialized.waitForTrue()
}
} catch (ex: Exception) {
Expand Down Expand Up @@ -412,13 +410,13 @@ class CoderRemoteProvider(
this.client = client
pollJob?.let {
it.cancel()
context.logger.info("Cancelled workspace poll job ${pollJob.name()} in order to start a new one")
context.logger.info("Cancelled workspace poll job ${pollJob.toString()} in order to start a new one")
}
environments.showLoadingMessage()
coderHeaderPage.setTitle(context.i18n.pnotr(client.url.toString()))
context.logger.info("Displaying ${client.url} in the UI")
pollJob = poll(client, cli)
context.logger.info("Workspace poll job with name ${pollJob.name()} was created")
context.logger.info("Workspace poll job with name ${pollJob.toString()} was created")
}

private fun MutableStateFlow<LoadableState<List<CoderRemoteEnvironment>>>.showLoadingMessage() {
Expand Down
6 changes: 0 additions & 6 deletions src/main/kotlin/com/coder/toolbox/util/CoroutineExtensions.kt

This file was deleted.

25 changes: 0 additions & 25 deletions src/main/kotlin/com/coder/toolbox/util/NameGenerator.kt

This file was deleted.

Loading