Skip to content

Commit efcd7a4

Browse files
committed
Move mutable callback_data to assignment later in record_meeting
1 parent e1c4050 commit efcd7a4

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

videodb/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def record_meeting(
304304
bot_image_url: str = None,
305305
meeting_title: str = None,
306306
callback_url: str = None,
307-
callback_data: dict = {},
307+
callback_data: Optional[dict] = None,
308308
time_zone: str = "UTC",
309309
) -> Meeting:
310310
"""Record a meeting and upload it to the default collection.
@@ -319,6 +319,8 @@ def record_meeting(
319319
:return: :class:`Meeting <Meeting>` object representing the recording bot
320320
:rtype: :class:`videodb.meeting.Meeting`
321321
"""
322+
if callback_data is None:
323+
callback_data = {}
322324

323325
response = self.post(
324326
path=f"{ApiPath.collection}/default/{ApiPath.meeting}/{ApiPath.record}",

videodb/collection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ def record_meeting(
520520
bot_image_url: str = None,
521521
meeting_title: str = None,
522522
callback_url: str = None,
523-
callback_data: dict = {},
523+
callback_data: Optional[dict] = None,
524524
time_zone: str = "UTC",
525525
) -> Meeting:
526526
"""Record a meeting and upload it to this collection.
@@ -535,6 +535,8 @@ def record_meeting(
535535
:return: :class:`Meeting <Meeting>` object representing the recording bot
536536
:rtype: :class:`videodb.meeting.Meeting`
537537
"""
538+
if callback_data is None:
539+
callback_data = {}
538540

539541
response = self._connection.post(
540542
path=f"{ApiPath.collection}/{self.id}/{ApiPath.meeting}/{ApiPath.record}",

videodb/meeting.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
VideodbError,
55
)
66

7+
DEFAULT_MEETING_TIMEOUT = 14400 # 4 hours
8+
DEFAULT_POLLING_INTERVAL = 120 # 2 minutes
9+
710

811
class Meeting:
912
"""Meeting class representing a meeting recording bot.
@@ -80,7 +83,10 @@ def is_completed(self) -> bool:
8083
return self.status == MeetingStatus.done
8184

8285
def wait_for_status(
83-
self, target_status: str, timeout: int = 14400, interval: int = 120
86+
self,
87+
target_status: str,
88+
timeout: int = DEFAULT_MEETING_TIMEOUT,
89+
interval: int = DEFAULT_POLLING_INTERVAL,
8490
) -> bool:
8591
"""Wait for the meeting to reach a specific status.
8692

0 commit comments

Comments
 (0)