Skip to content

Reduce and remove cache functions#535

Merged
braddf merged 8 commits intomainfrom
fix/cache-optimise
Mar 3, 2026
Merged

Reduce and remove cache functions#535
braddf merged 8 commits intomainfrom
fix/cache-optimise

Conversation

@braddf
Copy link
Contributor

@braddf braddf commented Mar 3, 2026

Pull Request

Description

remove save_api_call_to_db from status calls
make tracemalloc optional/on-demand
try/finally to avoid reqs following exception waiting 30s
reduce cache size
remove save_api_requests & session obj

Fixes #

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration

  • Yes

If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?

  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

```
"""
cache = TTLCache(maxsize=1024, ttl=cache_time_seconds)
cache = TTLCache(maxsize=128, ttl=cache_time_seconds)
Copy link
Collaborator

Choose a reason for hiding this comment

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

bump up to 512, becasue there are 318 gsps

Copy link
Collaborator

@peterdudfield peterdudfield left a comment

Choose a reason for hiding this comment

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

Incerase cache size, see comments

@braddf braddf merged commit 2343112 into main Mar 3, 2026
2 checks passed
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.

2 participants