This commit is contained in:
parent
49eec2de46
commit
55e28162fe
|
@ -1,14 +1,16 @@
|
||||||
from granian.constants import Interfaces
|
from granian.constants import Interfaces
|
||||||
from granian.server import Granian
|
from granian.server import Granian
|
||||||
|
import subprocess
|
||||||
from services.logger import root_logger as logger
|
from services.logger import root_logger as logger
|
||||||
from settings import PORT
|
from settings import PORT
|
||||||
|
|
||||||
|
|
||||||
def is_docker_container_running(name):
|
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
|
output = subprocess.run(cmd, capture_output=True, text=True).stdout
|
||||||
return name in output
|
return name in output
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
logger.info("started")
|
logger.info("started")
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ async def cache_follower(follower: dict, author: dict, is_insert=True):
|
||||||
else:
|
else:
|
||||||
followers = [e for e in followers if int(e["id"]) != author_id]
|
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}")
|
author_str = await redis.execute("GET", f"author:{follower_id}")
|
||||||
if isinstance(author_str, str):
|
if isinstance(author_str, str):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user