Skip to content

Commit

Permalink
Merge pull request #210 from aau-claaudia/stack-delete-add-logging
Browse files Browse the repository at this point in the history
Added logging for deleting stacks with shut off instances.
  • Loading branch information
nikko-andersen authored Aug 8, 2024
2 parents fcda01c + 150e30a commit e703d80
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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))
}
Expand Down

0 comments on commit e703d80

Please sign in to comment.