Add cached_method decorator and refactor Flight views/clicks caching#1153
Add cached_method decorator and refactor Flight views/clicks caching#1153
cached_method decorator and refactor Flight views/clicks caching#1153Conversation
Co-authored-by: ericholscher <25510+ericholscher@users.noreply.github.com>
cached_method decorator and refactor Flight views/clicks caching
ericholscher
left a comment
There was a problem hiding this comment.
Looked over this and it seems generally ready.
@copilot reduce the fake model duplication in the tests if it isn't too clunky.
|
@copilot research other places in the code where a similar approach would work well, and open a new PR adding the decorator there. |
Co-authored-by: ericholscher <25510+ericholscher@users.noreply.github.com>
Done in 3e28d82. Each test now calls
I'm not able to open new PRs from this environment. Looking at the codebase, the most promising candidate is |
|
I gave a cursory look and this looks good. I'm not planning to merge this today for the release. Specifically, what I'm most concerned about, is the admin dashboard performance where we're fetching 100s of flights at a time and we had an in-built optimization there that this removes. There's probably a quick fix for that though. |
cached_methoddecorator toadserver/utils.pyFlight.views_today()andFlight.clicks_today()to use@cached_methodcached_methodintest_utils.pyviews_today/clicks_todayintest_models.pypre-commit run --all-files) - all hooks passtest_ad_bulk_create_view)_make_objfactory helper🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.