Skip to content

Commit

Permalink
Update bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
NadavTasher committed Oct 12, 2024
1 parent 2fa26df commit f008d14
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions bundles/buildless/src/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Import the router
from utilities.redis import wait_for_redis_sync, broadcast_sync, broadcast_async, receive_sync, receive_async, redict
from utilities.starlette import router
from utilities.starlette import WebSocket, router

# Wait for redis to ping back before operating on database
wait_for_redis_sync()
Expand All @@ -25,7 +25,7 @@ def click_request() -> str:
logging.info("User clicked - count is now %d", DATABASE.count)

# Return the ping count
return "Click count is %d" % DATABASE.count
return f"Click count is {DATABASE.count}"


@router.post("/api/relay")
Expand All @@ -39,7 +39,7 @@ async def relay_request(message: str, sender: Optional[Email] = None) -> None:


@router.socket("/socket/relay")
async def relay_socket(websocket) -> None:
async def relay_socket(websocket: WebSocket) -> None:
# Accept the websocket
await websocket.accept()

Expand Down
2 changes: 1 addition & 1 deletion bundles/buildless/src/backend/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import threading

# Setup the logging
logging.basicConfig(level=logging.INFO, format="%(process)d:W %(asctime)s * %(message)s", datefmt="%d %b %Y %H:%M:%S.000")
logging.basicConfig(level=logging.INFO, format="[%(asctime)s] [%(process)d] [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S %z")

# Create stop event
EVENT = threading.Event()
Expand Down
6 changes: 3 additions & 3 deletions bundles/independent/application/src/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Import the router
from utilities.redis import wait_for_redis_sync, broadcast_sync, broadcast_async, receive_sync, receive_async, redict
from utilities.starlette import router
from utilities.starlette import WebSocket, router

# Wait for redis to ping back before operating on database
wait_for_redis_sync()
Expand All @@ -25,7 +25,7 @@ def click_request() -> str:
logging.info("User clicked - count is now %d", DATABASE.count)

# Return the ping count
return "Click count is %d" % DATABASE.count
return f"Click count is {DATABASE.count}"


@router.post("/api/relay")
Expand All @@ -39,7 +39,7 @@ async def relay_request(message: str, sender: Optional[Email] = None) -> None:


@router.socket("/socket/relay")
async def relay_socket(websocket) -> None:
async def relay_socket(websocket: WebSocket) -> None:
# Accept the websocket
await websocket.accept()

Expand Down
2 changes: 1 addition & 1 deletion bundles/independent/application/src/backend/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import threading

# Setup the logging
logging.basicConfig(level=logging.INFO, format="%(process)d:W %(asctime)s * %(message)s", datefmt="%d %b %Y %H:%M:%S.000")
logging.basicConfig(level=logging.INFO, format="[%(asctime)s] [%(process)d] [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S %z")

# Create stop event
EVENT = threading.Event()
Expand Down

0 comments on commit f008d14

Please sign in to comment.