This commit is contained in:
parent
49eec2de46
commit
55e28162fe
|
@ -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()
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user