Skip to content

Commit

Permalink
persist docker compose migration
Browse files Browse the repository at this point in the history
  • Loading branch information
shalom938 committed Dec 26, 2024
1 parent 9cd06b5 commit 0834fe5
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class UpdateBackendAction {

fun updateBackend(project: Project, backendDeploymentType: BackendDeploymentType, sourceComponent: JComponent?) {

Log.log(logger::info, "updateBackend invoked, backendDeploymentType {}, [t:{}]", backendDeploymentType, Thread.currentThread().name)

when (backendDeploymentType) {

BackendDeploymentType.Helm -> {
Expand All @@ -50,8 +52,10 @@ class UpdateBackendAction {
HintManager.getInstance()
.showHint(upgradePopupLabel, RelativePoint.getNorthWestOf(it), HintManager.HIDE_BY_ESCAPE, 5000)
}
Log.log(logger::info, "calling upgrade backend for local engine. [t:{}]", Thread.currentThread().name)
service<LocalInstallationFacade>().upgradeEngine(project) { exitValue ->
if (exitValue != "0") {
Log.log(logger::warn, "error upgrading local engine , exitValue {}. [t:{}]", exitValue, Thread.currentThread().name)
ErrorReporter.getInstance().reportError(
"UpdateBackendAction.upgradeLocalEngine",
"failed to upgrade local engine",
Expand Down Expand Up @@ -79,14 +83,15 @@ class UpdateBackendAction {


//call some api to refresh the connection status as soon as possible
private fun tryToUpdateConnectionStatusSoon(project: Project){
private fun tryToUpdateConnectionStatusSoon(project: Project) {
Log.log(logger::info, "trying to update connection status soon [t:{}]", Thread.currentThread().name)
repeat(24) { count ->
if (BackendConnectionMonitor.getInstance(project).isConnectionOk()) {
return@repeat
}

try {
Log.log(logger::warn, "waiting for connection {} [t:{}]", count,Thread.currentThread().name)
Log.log(logger::info, "waiting for connection {} [t:{}]", count, Thread.currentThread().name)
Thread.sleep(1000)
} catch (e: InterruptedException) {
//ignore
Expand All @@ -98,6 +103,12 @@ class UpdateBackendAction {
//ignore
}
}

if (!BackendConnectionMonitor.getInstance(project).isConnectionOk()) {
Log.log(logger::warn, "connection status is ok. [t:{}]", Thread.currentThread().name)
} else {
Log.log(logger::warn, "connection status is not ok. [t:{}]", Thread.currentThread().name)
}
}


Expand Down

0 comments on commit 0834fe5

Please sign in to comment.