Skip to content

Commit

Permalink
fix: add fix for #47
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Oct 9, 2023
1 parent 13e7061 commit 04f9c1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup = com.phodal.autodev
pluginName = AutoDev
pluginRepositoryUrl = https://github.com/unit-mesh/auto-dev
# SemVer format -> https://semver.org
pluginVersion = 1.2.2
pluginVersion = 1.2.3

# Supported IDEs: idea, pycharm
baseIDE=idea
Expand Down
18 changes: 9 additions & 9 deletions src/main/kotlin/cc/unitmesh/devti/gui/chat/ChatCodingPanel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ class ChatCodingPanel(private val chatCodingService: ChatCodingService, val disp
}
}

val elapsedTime = System.currentTimeMillis() - startTime

// waiting for the last message to be rendered, like sleep 5 ms?
// 此处的 20s 出自 openAI 免费账户访问 3/min
withContext(Dispatchers.IO) {

val delaySec = delaySeconds.toLong() ?: 20L
val remainingTime = maxOf(delaySec * 1000 - elapsedTime, 0)
delay(remainingTime)
if (delaySeconds.isNotEmpty()) {
val elapsedTime = System.currentTimeMillis() - startTime
// waiting for the last message to be rendered, like sleep 5 ms?
// 此处的 20s 出自 openAI 免费账户访问 3/min
withContext(Dispatchers.IO) {
val delaySec = delaySeconds.toLong() ?: 20L
val remainingTime = maxOf(delaySec * 1000 - elapsedTime, 0)
delay(remainingTime)
}
}

messageView.reRenderAssistantOutput()
Expand Down

0 comments on commit 04f9c1b

Please sign in to comment.