Skip to content

Commit

Permalink
try a new redys.v2.loop to start all
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan committed Oct 3, 2023
1 parent aa0513e commit 9fd9b0b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions htagweb/appserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from . import crypto
import redys.v2

from htagweb.server import hrserver, wait_hrserver
from htagweb.server import hrserver, hrserver_orchestrator, wait_hrserver
from htagweb.server.client import HrClient

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -184,18 +184,19 @@ async def on_disconnect(self, websocket, close_code):


def processHrServer():
asyncio.run( hrserver() )
asyncio.run( redys.v2.loop(hrserver_orchestrator()) )


async def lifespan(app):
process_hrserver=multiprocessing.Process(target=processHrServer)
process_hrserver.start()

await wait_hrserver()

# await wait_hrserver()

yield

process_hrserver.kill()
# process_hrserver.kill()


class AppServer(Starlette):
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ htag = "^0.42"
starlette = "0.29.0"
pycryptodomex = "^3.19.0"
uvicorn = {version = "0.22.0", extras = ["standard"]}
redys = "0.9.9"
redys = "^0.9"


[tool.poetry.group.dev.dependencies]
Expand Down

0 comments on commit 9fd9b0b

Please sign in to comment.