From bd72578d9edead904aaeb86c8512a65299b1330f Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Sun, 30 Jun 2024 00:36:25 -0300 Subject: [PATCH] More refactor --- src/faaso.cr | 8 ++------ src/funko.cr | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/faaso.cr b/src/faaso.cr index 721c381..82811a6 100644 --- a/src/faaso.cr +++ b/src/faaso.cr @@ -125,16 +125,12 @@ module Faaso response = docker_api.containers.create(name: container_name, config: conf) response.@warnings.each { |msg| puts "Warning: #{msg}" } docker_api.containers.start(response.@id) - containers = docker_api.containers.list( - all: true, - filters: {"name" => [container_name]} - ) (1..5).each { |_| - break if containers[0].state == "running" + break if funko.running? sleep 0.1.seconds } - if containers[0].state != "running" + if !funko.running? puts "Container for #{funko.name} is not running yet" next end diff --git a/src/funko.cr b/src/funko.cr index 6f543d1..6fddef0 100644 --- a/src/funko.cr +++ b/src/funko.cr @@ -1,5 +1,6 @@ require "yaml" +# A funko, built from its source metadata class Funko include YAML::Serializable