Skip to content

Commit

Permalink
Merge pull request #110 from uberduck-ai/zach-bugfixes
Browse files Browse the repository at this point in the history
increase number of attempts for daily recording
  • Loading branch information
zachwe committed Mar 28, 2024
2 parents 3ae47ee + c0efc47 commit 618b46d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions openduck-py/openduck_py/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
LOG_TO_SLACK = bool(os.environ.get("LOG_TO_SLACK", False))
CHAT_MODEL = "azure/gpt-35-turbo-deployment"
CHAT_MODEL_GPT4 = "azure/gpt-4-deployment"
CHAT_MODEL_GROQ = "groq/mixtral-8x7b-32768"
AUDIO_UPLOAD_BUCKET = os.environ.get("AUDIO_UPLOAD_BUCKET", "openduck-us-west-2")
LOG_TO_S3 = True

Expand Down
3 changes: 2 additions & 1 deletion openduck-py/openduck_py/utils/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class RoomCreateResponse(BaseModel):

async def start_recording(room_url: str) -> Optional[str]:
daily_recording_id = None
NUM_ATTEMPTS = 10
async with httpx.AsyncClient() as _http_client:
room_id = room_url.split("/")[-1]
print(f"Room ID: {room_id}")
Expand All @@ -27,7 +28,7 @@ async def start_recording(room_url: str) -> Optional[str]:
f"https://api.daily.co/v1/rooms/{room_id}/recordings/start",
headers={"Authorization": f"Bearer {os.environ['DAILY_API_KEY']}"},
)
if _recording_response.status_code == 404 and attempt < 2:
if _recording_response.status_code == 404 and attempt < NUM_ATTEMPTS:
await asyncio.sleep(0.1) # Sleep for 100ms before retrying
else:
_recording_response.raise_for_status()
Expand Down

0 comments on commit 618b46d

Please sign in to comment.