Skip to content

Commit

Permalink
fix: remove time.sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard committed Jan 7, 2025
1 parent 4997606 commit 18979b5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
2 changes: 0 additions & 2 deletions backend/chainlit/message.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import json
import time
import uuid
from abc import ABC
from typing import Dict, List, Optional, Union, cast
Expand Down Expand Up @@ -218,7 +217,6 @@ def __init__(
parent_id: Optional[str] = None,
created_at: Union[str, None] = None,
):
time.sleep(0.001)
self.language = language
if isinstance(content, dict):
try:
Expand Down
3 changes: 0 additions & 3 deletions backend/chainlit/socket.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import json
import time
from typing import Any, Dict, Literal, Optional, Tuple, Union
from urllib.parse import unquote

Expand Down Expand Up @@ -258,8 +257,6 @@ async def process_message(session: WebsocketSession, payload: MessagePayload):
message = await context.emitter.process_message(payload)

if config.code.on_message:
# Sleep 1ms to make sure any children step starts after the message step start
time.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 @@ -192,7 +191,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 18979b5

Please sign in to comment.