Skip to content

Commit

Permalink
fix: remove sleep from step and process_message
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard committed Jan 8, 2025
1 parent 88111bf commit add18d8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion backend/chainlit/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ async def process_message(session: WebsocketSession, payload: MessagePayload):
message = await context.emitter.process_message(payload)

if config.code.on_message:
await asyncio.sleep(0.001)
await config.code.on_message(message)
except asyncio.CancelledError:
pass
Expand Down
2 changes: 0 additions & 2 deletions backend/chainlit/step.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import asyncio
import inspect
import json
import time
import uuid
from copy import deepcopy
from functools import wraps
Expand Down Expand Up @@ -193,7 +192,6 @@ def __init__(
thread_id: Optional[str] = None,
):
trace_event(f"init {self.__class__.__name__} {type}")
time.sleep(0.001)
self._input = ""
self._output = ""
self.thread_id = thread_id or context.session.thread_id
Expand Down

0 comments on commit add18d8

Please sign in to comment.