Pass required argument to homepage caching function#11606
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses an issue where the required devmode argument was not being passed to the homepage caching function, resulting in web.py errors when a blank homepage is cached. The fix extracts the devmode value into a variable and passes it as an argument to the memoized cache function calls.
Key changes:
- Extracts
devmodedetermination into a variable for reuse - Passes
devmodeargument tomc()calls andmemcache_delete_by_args() - Ensures the
get_homepage()function receives its required parameter
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| mc.memcache_delete_by_args() | ||
| mc() | ||
| mc.memcache_delete_by_args(devmode) | ||
| mc(devmode) |
There was a problem hiding this comment.
The return value of mc(devmode) is not being captured. When the cached page is empty/None, the cache is cleared on line 72, but the regenerated page on line 73 is not assigned to the page variable. This means line 75 will still return the empty/None value instead of the newly generated page. The line should be: page = mc(devmode)
| mc(devmode) | |
| page = mc(devmode) |
There was a problem hiding this comment.
This is right. Not sure if the mc call should just be removed in these cases.
Follows https://github.com/internetarchive/openlibrary/pull/11092/files#r2632215768
Required argument
devmodeis not being passed to the homepage caching function, resulting inweb.pyerror page when a blank homepage is cached.Technical
Testing
Screenshot
Stakeholders