From a7d7c9f8180f3bad52632053095eff21eb30e06a Mon Sep 17 00:00:00 2001 From: Kenneth Endfinger Date: Thu, 23 Dec 2021 02:47:32 -0500 Subject: [PATCH] DevUpdateServer: Properly handle update in callback. --- .../foundation/core/devupdate/DevUpdateServer.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/foundation-core/src/main/kotlin/cloud/kubelet/foundation/core/devupdate/DevUpdateServer.kt b/foundation-core/src/main/kotlin/cloud/kubelet/foundation/core/devupdate/DevUpdateServer.kt index 02a8fe3..07d03eb 100644 --- a/foundation-core/src/main/kotlin/cloud/kubelet/foundation/core/devupdate/DevUpdateServer.kt +++ b/foundation-core/src/main/kotlin/cloud/kubelet/foundation/core/devupdate/DevUpdateServer.kt @@ -96,12 +96,13 @@ class DevUpdateServer(val plugin: FoundationCorePlugin) { exchange.respond(200, "Success.") plugin.slF4JLogger.info("DevUpdate Started") - UpdateService.updatePlugins(plugin.server.consoleSender) - plugin.server.scheduler.runTask(plugin) { -> - try { - plugin.server.shutdown() - } catch (e: Exception) { - plugin.slF4JLogger.error("DevUpdate Server failed to update server.", e) + UpdateService.updatePlugins(plugin.server.consoleSender) { + plugin.server.scheduler.runTask(plugin) { -> + try { + plugin.server.shutdown() + } catch (e: Exception) { + plugin.slF4JLogger.error("DevUpdate Server failed to update server.", e) + } } } }