Skip to content

Commit

Permalink
Merge branch 'main' into workspace-test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishrp-aws authored Jan 16, 2025
2 parents 4662cca + 5e5ba0e commit 62f896d
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ import software.aws.toolkits.jetbrains.services.amazonqCodeTest.session.Session
class ChatSessionStorage {
private val sessions = mutableMapOf<String, Session>()

private fun createSession(tabId: String): Session {
val session = Session(tabId)
sessions[tabId] = session
return session
}

fun getSession(tabId: String): Session = sessions[tabId] ?: createSession(tabId)
@Synchronized
fun getSession(tabId: String): Session = sessions.getOrPut(tabId) { Session(tabId) }

fun deleteSession(tabId: String) {
sessions.remove(tabId)
Expand Down

0 comments on commit 62f896d

Please sign in to comment.