X Tutup
Skip to content

Pass required argument to homepage caching function#11606

Merged
mekarpeles merged 1 commit intomasterfrom
home-page-mc
Dec 22, 2025
Merged

Pass required argument to homepage caching function#11606
mekarpeles merged 1 commit intomasterfrom
home-page-mc

Conversation

@jimchamp
Copy link
Collaborator

Follows https://github.com/internetarchive/openlibrary/pull/11092/files#r2632215768

Required argument devmode is not being passed to the homepage caching function, resulting in web.py error page when a blank homepage is cached.

Technical

Testing

Screenshot

Stakeholders

Copilot AI review requested due to automatic review settings December 18, 2025 18:48
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 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 devmode determination into a variable for reuse
  • Passes devmode argument to mc() calls and memcache_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)
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

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

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)

Suggested change
mc(devmode)
page = mc(devmode)

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is right. Not sure if the mc call should just be removed in these cases.

@jimchamp jimchamp marked this pull request as draft December 18, 2025 18:55
@jimchamp jimchamp marked this pull request as ready for review December 18, 2025 19:08
@mekarpeles mekarpeles merged commit 8c36dfc into master Dec 22, 2025
14 checks passed
@mekarpeles mekarpeles self-assigned this Dec 22, 2025
@jimchamp jimchamp deleted the home-page-mc branch February 11, 2026 23:12
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

X Tutup