Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
The cache age should be in milliseconds.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Sep 21, 2021
1 parent a6cf905 commit a3bb63c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions synapse/rest/media/v1/oembed.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
class OEmbedResult:
# The Open Graph result (converted from the oEmbed result).
open_graph_result: JsonDict
# Number of seconds to cache the content, according to the oEmbed response.
# Number of milliseconds to cache the content, according to the oEmbed response.
#
# This will be None if no cache-age is provided in the oEmbed response (or
# if the oEmbed response cannot be turned into an Open Graph response).
Expand Down Expand Up @@ -121,7 +121,7 @@ def parse_oembed_response(self, url: str, raw_body: bytes) -> OEmbedResult:
# Ensure the cache age is None or an int.
cache_age = oembed.get("cache_age")
if cache_age:
cache_age = int(cache_age)
cache_age = int(cache_age) * 1000

# The results.
open_graph_response = {
Expand Down

0 comments on commit a3bb63c

Please sign in to comment.