Skip to content

Commit

Permalink
fix(client): accidental blocking sleep in async code (#1415)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed May 13, 2024
1 parent ed73d1d commit 0ac6ecb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/openai/resources/beta/threads/runs/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from __future__ import annotations

import time
import typing_extensions
from typing import Union, Iterable, Optional, overload
from functools import partial
Expand Down Expand Up @@ -1105,7 +1104,7 @@ def poll(
else:
poll_interval_ms = 1000

time.sleep(poll_interval_ms / 1000)
self._sleep(poll_interval_ms / 1000)

@overload
def stream(
Expand Down Expand Up @@ -2639,7 +2638,7 @@ async def poll(
else:
poll_interval_ms = 1000

time.sleep(poll_interval_ms / 1000)
await self._sleep(poll_interval_ms / 1000)

@overload
def stream(
Expand Down

0 comments on commit 0ac6ecb

Please sign in to comment.