Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove time.sleep #1634

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading