Skip to content

Commit

Permalink
update datetime.utcnow() to use UTC timezone-aware object (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
lebaudantoine authored Nov 5, 2024
1 parent 7380485 commit 6ea5452
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions livekit-api/livekit/api/access_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class VideoGrants:
can_publish_data: bool = True

# TrackSource types that a participant may publish.
# When set, it supercedes CanPublish. Only sources explicitly set here can be
# When set, it supersedes CanPublish. Only sources explicitly set here can be
# published
can_publish_sources: List[str] = dataclasses.field(default_factory=list)

Expand Down Expand Up @@ -154,9 +154,9 @@ def to_jwt(self) -> str:
{
"sub": self.identity,
"iss": self.api_key,
"nbf": calendar.timegm(datetime.datetime.utcnow().utctimetuple()),
"nbf": calendar.timegm(datetime.datetime.now(datetime.timezone.utc).utctimetuple()),
"exp": calendar.timegm(
(datetime.datetime.utcnow() + self.ttl).utctimetuple()
(datetime.datetime.now(datetime.timezone.utc) + self.ttl).utctimetuple()
),
}
)
Expand Down
2 changes: 1 addition & 1 deletion livekit-rtc/livekit/rtc/_proto/ffi_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions livekit-rtc/livekit/rtc/_proto/handle_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit-rtc/livekit/rtc/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def register_rpc_method(
Establishes the participant as a receiver for calls of the specified RPC method.
Can be used either as a decorator or a regular method.
The handler will recieve one argument of type `RpcInvocationData` and should return a string response which will be forwarded back to the caller.
The handler will receive one argument of type `RpcInvocationData` and should return a string response which will be forwarded back to the caller.
The handler may be synchronous or asynchronous.
Expand Down
2 changes: 1 addition & 1 deletion livekit-rtc/livekit/rtc/video_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def _get_plane_length(
type: proto_video.VideoBufferType.ValueType, width: int, height: int
) -> int:
"""
Return the size in bytes of a participar video buffer type based on its size (This ignore the strides)
Return the size in bytes of a participant video buffer type based on its size (This ignores the strides)
"""
if type in [
proto_video.VideoBufferType.ARGB,
Expand Down

0 comments on commit 6ea5452

Please sign in to comment.