I dont even remember

This commit is contained in:
iamBadgers
2026-07-18 18:41:20 -07:00
parent f18a521747
commit a66d2133a0
3 changed files with 21 additions and 10 deletions

View File

@@ -3,10 +3,11 @@ import os
import socket
import inspect
import shutil
import requests
from flask import current_app
from game_table_model import GameTable
from key_model import TableKey
from time import sleep
def build_container_routing_labels(prefix: str, strip_prefix=True):
host_name = os.environ.get("API_HOST_NAME") or "localhost"
@@ -59,7 +60,7 @@ def stop_container(docker_id) -> bool:
try:
client = docker.from_env()
container = client.containers.get(docker_id)
container.kill()
container.stop()
return True
except (docker.errors.NotFound, docker.errors.APIError):
return False
@@ -146,5 +147,22 @@ def start_foundry_container(table: GameTable, key: TableKey):
detach=True,
network=networkName,
)
current_app.logger.info(container.attrs)
count = 0
current_app.logger.info("Here:")
container.reload()
current_app.logger.info(container.status)
sleep(2)
while(container.status == "running" and count < 10):
current_app.logger.info(count)
current_app.logger.info(requests.get("http://proxy:8080/api/http/routers").json())
container.reload()
count = count + 1
sleep(1)
container.reload()
if (container.status != "running"):
raise "Fuck"
return container.id