From 150e30a10b79ca44bf23d184ea0580d3f0455a4c Mon Sep 17 00:00:00 2001 From: Nikolaj Andersen Date: Wed, 7 Aug 2024 14:23:34 +0200 Subject: [PATCH] Added logging for deleting stacks with shut off instances. --- .../claaudia/openstackgateway/services/OpenStackService.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/dk/aau/claaudia/openstackgateway/services/OpenStackService.kt b/src/main/kotlin/dk/aau/claaudia/openstackgateway/services/OpenStackService.kt index a8ee208a..bc82e175 100644 --- a/src/main/kotlin/dk/aau/claaudia/openstackgateway/services/OpenStackService.kt +++ b/src/main/kotlin/dk/aau/claaudia/openstackgateway/services/OpenStackService.kt @@ -1293,7 +1293,7 @@ class OpenStackService( it.flavorName == stackWithParameters.parameters["flavor"] } val maxLifetime = flavorLifetime?.lifetimeDays ?: config.janitor.deleteShutoffInstanceAfterDays - + logger.info("Stack with shutoff instance found ${activeStack.id} $lastCharged, $isShutoff, time since last charge in hours: ${sinceLastCharge.toHours()}") if (sinceLastCharge.toDays() >= maxLifetime) { val job: Job? = retrieveUcloudJob(activeStack.ucloudId) @@ -1302,7 +1302,7 @@ class OpenStackService( return } - logger.info("Deleting stack with shutoff instance ${activeStack.id} $lastCharged, $isShutoff ${sinceLastCharge.toDays()}") + logger.info("Deleting stack with shutoff instance ${activeStack.id} $lastCharged, $isShutoff, time since last charge in days: ${sinceLastCharge.toDays()}") deleteJob(job) asyncMonitorDeletions(listOf(job)) }