subprocess-fix
All checks were successful
Deploy on push / deploy (push) Successful in 27s

This commit is contained in:
2024-05-06 10:53:27 +03:00
parent 49eec2de46
commit 55e28162fe
2 changed files with 6 additions and 4 deletions

View File

@@ -1,14 +1,16 @@
from granian.constants import Interfaces
from granian.server import Granian
import subprocess
from services.logger import root_logger as logger
from settings import PORT
def is_docker_container_running(name):
cmd = ['docker', 'ps', '-f', f'name={name}']
cmd = ["docker", "ps", "-f", f"name={name}"]
output = subprocess.run(cmd, capture_output=True, text=True).stdout
return name in output
if __name__ == "__main__":
logger.info("started")
@@ -20,4 +22,4 @@ if __name__ == "__main__":
websockets=False,
interface=Interfaces.ASGI,
)
granian_instance.serve()
granian_instance.serve()