Skip to content

Commit

Permalink
1.8.4 (#200)
Browse files Browse the repository at this point in the history
* 1.8.3

* 1.8.3

* 1.8.4

* 1.8.4
  • Loading branch information
acharneski authored Nov 11, 2024
1 parent 1cc7c5e commit 545a3ad
Show file tree
Hide file tree
Showing 4 changed files with 301 additions and 136 deletions.
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
pluginName=intellij-aicoder
pluginRepositoryUrl=https://github.com/SimiaCryptus/intellij-aicoder
pluginVersion=1.8.3
pluginVersion=1.8.4
jvmArgs=-Xmx8g
org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=1g
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=233
pluginUntilBuild=242.*
platformType=IU
platformVersion=2024.2
gradleVersion=8.10.2
Expand Down
51 changes: 28 additions & 23 deletions src/main/kotlin/com/github/simiacryptus/aicoder/AppServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,38 +50,43 @@ class AppServer(


private val serverLock = Object()
private val progressThread = Thread {
try {
UITools.run(
project, "Running CodeChat Server on $port", false
) {
while (isRunning(it)) {
Thread.sleep(1000)
}
synchronized(serverLock) {
if (it.isCanceled) {
log.info("Server cancelled")
server.stop()
} else {
log.info("Server stopped")
}
}
}
} finally {
log.info("Stopping Server")
server.stop()
}
}
// private val progressThread = Thread {
// try {
// UITools.run(
// project, "Running CodeChat Server on $port", false
// ) {
// while (isRunning(it)) {
// Thread.sleep(1000)
// }
// synchronized(serverLock) {
// if (it.isCanceled) {
// log.info("Server cancelled")
// server.stop()
// } else {
// log.info("Server stopped")
// }
// }
// }
// } finally {
// log.info("Stopping Server")
// server.stop()
// }
// }

private fun isRunning(it: ProgressIndicator) = synchronized(serverLock) { !it.isCanceled && server.isRunning }

fun start() {
server.start()
progressThread.start()
// progressThread.start()
}

companion object {
@Transient
private var server: AppServer? = null
fun isRunning(): Boolean {
return server?.server?.isRunning ?: false
}

fun getServer(project: Project?): AppServer {
if (null == server || !server!!.server.isRunning) {
server = AppServer(
Expand Down
Loading

0 comments on commit 545a3ad

Please sign in to comment.