Repository navigation
Pattern Translations: Clear runtime caches after each locale - #784
Conversation
Some patterns exhaust the 512M memory limit while being processed across all locales, so the chunks containing them fail on every run. Clear the runtime caches after each locale rather than after each pattern. Use wp_cache_flush_runtime() rather than resetting object cache internals, which also avoids the deprecation notice for the removed `memcache_debug` property. Log each pattern ID when running in cron, as WP_CLI::log() output isn't captured by Cavalcade.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe cron translation import now logs each pattern ID and name. It clears memory-heavy variables after each locale and uses ChangesTranslation import cron
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established by the reviewed changes. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
pattern_import_translations_to_directoryhas a handful of chunks that fail on every run withAllowed memory size of 536870912 bytes exhaustedinobject-cache.php. The failures follow specific patterns as chunk boundaries shift, and several die allocating 2.5MB, which is a hash table resize of the runtime cache. So the cache is outgrowing the limit while one pattern is being processed across all locales, before the per-pattern cleanup ever runs.wp_cache_flush_runtime()instead of resetting object cache internals. This also fixes theCreation of dynamic property WPORG_Object_Cache::$memcache_debugdeprecation notice on every run.error_log()when running in cron. Cavalcade doesn't captureWP_CLI::log()output, so there's currently no way to tell which pattern a failing chunk dies on.Not verified against a live run. If a chunk still fails, the new log line names the pattern.
🤖 Generated with Claude Code
Summary by CodeRabbit