Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ class ScheduledSurfaceBackend(ScheduledSurfaceProtocol):
metrics_client: aiodogstatsd.Client
manifest_provider: ManifestProvider

# Time-to-live was chosen because 1 minute (+/- 10 s) is short enough that updates by curators
# Time-to-live was chosen because 2 minutes (+/- 10 s) is short enough that updates by curators
# such as breaking news or editorial corrections propagate fast enough, and that the request
# rate to the scheduledSurface query stays close to the historic rate of ~100 requests/minute.
cache_time_to_live_min = timedelta(seconds=50)
cache_time_to_live_max = timedelta(seconds=70)
cache_time_to_live_min = timedelta(seconds=110)
cache_time_to_live_max = timedelta(seconds=130)
_cache: dict
_background_tasks: set[asyncio.Task]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(
self._background_tasks = set()

@stale_while_revalidate(
wait_expiration=WaitRandomExpiration(timedelta(seconds=50), timedelta(seconds=70)),
wait_expiration=WaitRandomExpiration(timedelta(seconds=110), timedelta(seconds=130)),
cache=lambda self: self._cache,
jobs=lambda self: self._background_tasks,
)
Expand Down
Loading