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

update datetime.utcnow() to use UTC timezone-aware object #302

Merged
merged 3 commits into from
Nov 5, 2024
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
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
Loading