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

This commit is contained in:
Untone 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()

View File

@ -112,7 +112,7 @@ async def cache_follower(follower: dict, author: dict, is_insert=True):
else:
followers = [e for e in followers if int(e["id"]) != author_id]
followers = list(set(followers))
followers = [dict(d) for d in set(tuple(d.items()) for d in followers)]
author_str = await redis.execute("GET", f"author:{follower_id}")
if isinstance(author_str, str):