Skip to content

Commit 5e5ba0e

Browse files
telemetry(AmazonQ) ProgrammingLanguage is unknown (#5267)
* telemetry: fix the unknown language issue * telemetry fix the unknown language issue and remove the wrong print
1 parent 809538a commit 5e5ba0e

File tree

1 file changed

+2
-7
lines changed
  • plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/storage

1 file changed

+2
-7
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/storage/ChatSessionStorage.kt

+2-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@ import software.aws.toolkits.jetbrains.services.amazonqCodeTest.session.Session
88
class ChatSessionStorage {
99
private val sessions = mutableMapOf<String, Session>()
1010

11-
private fun createSession(tabId: String): Session {
12-
val session = Session(tabId)
13-
sessions[tabId] = session
14-
return session
15-
}
16-
17-
fun getSession(tabId: String): Session = sessions[tabId] ?: createSession(tabId)
11+
@Synchronized
12+
fun getSession(tabId: String): Session = sessions.getOrPut(tabId) { Session(tabId) }
1813

1914
fun deleteSession(tabId: String) {
2015
sessions.remove(tabId)

0 commit comments

Comments
 (0)