Skip to content

Commit

Permalink
Use Instance.State.ON instead of "on"
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-goral authored and mergify-bot committed Apr 30, 2021
1 parent ddd615a commit e68c19a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private suspend fun getCreatedInstances(
private suspend fun startNotRunningInstances(
instances: List<Instance>
): Unit = instances
.filter { it.state != "on" }
.filter { it.state != Instance.State.ON }
.apply { if (isNotEmpty()) println("Starting not running $size instances.") }
.forEach { instance ->
corellium.startInstance(instance.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ suspend fun Corellium.waitUntilInstanceIsReady(
instanceId: String
): Unit =
withRetry {
while (getInstanceInfo(instanceId).state != "on") {
while (getInstanceInfo(instanceId).state != Instance.State.ON) {
// it could takes long time
// if instance was created just moment ago
// TODO: adjust the delay time depending on returned state
Expand Down

0 comments on commit e68c19a

Please sign in to comment.