Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status page bug fixes #788

Merged
merged 5 commits into from
Jul 15, 2024
Merged

Status page bug fixes #788

merged 5 commits into from
Jul 15, 2024

Conversation

alycejenni
Copy link
Member

  • cache iiif status response for 300s
  • timeout response after 5s
  • add helper to check if route exists
  • use helper to check if status.index exists before using it



@cached(cache=TTLCache(maxsize=1024, ttl=300))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably the maxsize=1024 here is just an arbitary number given there's no arguments on the function so there will always only ever be 1 item in the cache? Doesn't need to be changed or anything, just checking my understanding is correct.

Also, unless I'm misunderstanding how cachetools implements a TTL cache, this will cache the function result for 5 mins but that 5 mins TTL will be reset each time the function is called. So if we still tie calling this function to page requests and we consistently get at least 1 page request every 5 mins, the status will never be updated as the cached copy will live forever?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maxsize is probably unnecessary, I'll remove it.
The TTL doesn't get reset every time it's requested so it should be fine (confirmed by me testing and you going through the code)

@coveralls
Copy link

coveralls commented Jul 12, 2024

Coverage Status

coverage: 33.017% (+0.001%) from 33.016%
when pulling 28994d3 on ginger/status-bugs
into 3c3b247 on dev.

@alycejenni alycejenni merged commit 6d3acb6 into dev Jul 15, 2024
3 checks passed
@alycejenni alycejenni deleted the ginger/status-bugs branch July 15, 2024 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants