Skip to content

Commit

Permalink
Addressed PR comments
Browse files Browse the repository at this point in the history
-- Added clarifying method comments
-- Fixed a linter error
  • Loading branch information
turetske committed Nov 4, 2024
1 parent 8a6c68d commit 945efad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/pelicanfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ class InvalidMetadata(PelicanException):
"""

class _AccessResp:
"""
A class representing a cache response.
Include's the full html request path, called access_path, which is a the cache's url
and the namespace prefix. It also includes whether the access was successful and
an error string if it exists
"""
def __init__(self, path: str, success: bool, error: Optional[str] = None):
self.access_path = path
self.success = success
Expand All @@ -65,7 +72,8 @@ def __init__(self):
Manage the cache access stats
For each namespace path, keep a list of the last three cache responses, including the
cache path, a boolean which is try if successful, and an error string if not
full cache url plus the object path, a boolean which is true if the access was
successful and false otherwise, and an optional error string if the access returned an error
"""
self.data: Dict[str, List[_AccessResp]] = {}

Expand Down
3 changes: 2 additions & 1 deletion test/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ def test_response_management():

# Test no responses for path
k, e = aStats.get_responses("no_path")
assert e == False
assert e == False

0 comments on commit 945efad

Please sign in to comment.