Skip to content

Conversation

@cigamit
Copy link
Contributor

@cigamit cigamit commented Dec 9, 2025

This causes an expensive query and the view sometimes called excessively by the UI. Memoize per unique user and params (time period) for 15s.

@cigamit cigamit requested a review from TheWitness December 9, 2025 03:24
@cigamit cigamit self-assigned this Dec 9, 2025
Copilot AI review requested due to automatic review settings December 9, 2025 03:24
@cigamit cigamit added enhancement New feature or request python Pull requests that update python code labels Dec 9, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements caching for the expensive dashboard jobs graph query to improve performance. The view is called excessively by the UI, and the underlying database query is resource-intensive. The solution memoizes the query results for 15 seconds based on unique user ID and query parameters (time period and job type).

Key changes:

  • Refactored dashboard computation logic into a separate static method _compute_dashboard_jobs_graph
  • Applied @memoize(ttl=15) decorator to cache results for 15 seconds per unique parameter combination
  • Converted user object to user_id for proper caching key generation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cigamit cigamit merged commit 71d98a4 into main Dec 9, 2025
6 checks passed
@cigamit cigamit deleted the upstream16165 branch December 9, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python Pull requests that update python code

Development

Successfully merging this pull request may close these issues.

3 participants