Skip to content

Commit

Permalink
Removed more max_cache_age occurrences
Browse files Browse the repository at this point in the history
  • Loading branch information
RishiDiwanTT committed Oct 23, 2023
1 parent b2ea139 commit 17a4ef7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
3 changes: 0 additions & 3 deletions core/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ class FacetConstants:
ENTRY_POINT_REL = "http://librarysimplified.org/terms/rel/entrypoint"
ENTRY_POINT_FACET_GROUP_NAME = "entrypoint"

# Query arguments can change how long a feed is to be cached.
MAX_CACHE_AGE_NAME = "max_age"

# Subset the collection, roughly, by quality.
COLLECTION_FACET_GROUP_NAME = "collection"
COLLECTION_FULL = "full"
Expand Down
13 changes: 2 additions & 11 deletions core/lane.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ class BaseFacets(FacetConstants):
This is intended solely for use as a base class.
"""

# By default, faceting objects have no opinion on how long the feeds
# generated using them should be cached.
max_cache_age = None

def items(self):
"""Yields a 2-tuple for every active facet setting.
Expand Down Expand Up @@ -146,18 +142,13 @@ class FacetsWithEntryPoint(BaseFacets):
selected EntryPoint.
"""

def __init__(
self, entrypoint=None, entrypoint_is_default=False, max_cache_age=None, **kwargs
):
def __init__(self, entrypoint=None, entrypoint_is_default=False, **kwargs):
"""Constructor.
:param entrypoint: An EntryPoint (optional).
:param entrypoint_is_default: If this is True, then `entrypoint`
is a default value and was not determined by a user's
explicit choice.
:param max_cache_age: Any feeds generated by this faceting object
will be cached for this amount of time. The default is to have
no opinion and let the Worklist manage this.
:param kwargs: Other arguments may be supplied based on user
input, but the default implementation is to ignore them.
"""
Expand Down Expand Up @@ -297,7 +288,7 @@ def load_entrypoint(cls, name, valid_entrypoints, default=None):
def items(self):
"""Yields a 2-tuple for every active facet setting.
In this class that just means the entrypoint and any max_cache_age.
In this class that just means the entrypoint.
"""
if self.entrypoint:
yield (self.ENTRY_POINT_FACET_GROUP_NAME, self.entrypoint.INTERNAL_NAME)
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_lane.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_navigate(self):
old_entrypoint = object()
kwargs = dict(extra_key="extra_value")
facets = FacetsWithEntryPoint(
old_entrypoint, entrypoint_is_default=True, max_cache_age=123, **kwargs
old_entrypoint, entrypoint_is_default=True, **kwargs
)
new_entrypoint = object()
new_facets = facets.navigate(new_entrypoint)
Expand Down

0 comments on commit 17a4ef7

Please sign in to comment.