Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "bugfix",
"description" : "Fix pointless busy loop in Amazon Q wasting CPU cycles (#5000)"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withTimeout
import kotlinx.coroutines.yield
import software.aws.toolkits.core.utils.debug
import software.aws.toolkits.core.utils.error
import software.aws.toolkits.core.utils.getLogger
Expand All @@ -48,14 +47,15 @@
return@launch
}

// TODO: need better solution for this
@Suppress("LoopWithTooManyJumpStatements")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context team to follow up with better solution

while (true) {
if (encoderServer.isNodeProcessRunning()) {
// TODO: need better solution for this
delay(10000)
initAndIndex()
break
} else {
yield()
delay(10000)

Check warning on line 58 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt#L58

Added line #L58 was not covered by tests
}
}
}
Expand Down
Loading