Skip to content

Commit

Permalink
fix(web.utils): WebFeed: TypeError
Browse files Browse the repository at this point in the history
Signed-off-by: Rongrong <[email protected]>
  • Loading branch information
Rongronggg9 committed Nov 4, 2024
1 parent e7120ff commit 3dfc340
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/web/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,10 @@ def calc_next_check_as_per_server_side_cache(self) -> Optional[datetime]:
# defer next check as per Cloudflare cache
# https://developers.cloudflare.com/cache/concepts/cache-responses/
# https://developers.cloudflare.com/cache/how-to/edge-browser-cache-ttl/
if (
self.headers.get('cf-cache-status') in {'HIT', 'MISS', 'EXPIRED', 'REVALIDATED'}
and
wr.expires > now
):
return wr.expires
if self.headers.get('cf-cache-status') in {'HIT', 'MISS', 'EXPIRED', 'REVALIDATED'}:
expires = wr.expires
if expires and expires > now:
return expires

# defer next check as per RSSHub TTL (or Cache-Control max-age)
# only apply when TTL > 5min,
Expand Down

0 comments on commit 3dfc340

Please sign in to comment.