This is handy when upgrading Koha or fiddling with config.
Created attachment 60922 [details] [review] Bug 18232 - Koha::Cache::flush - Simply flush all caches So we can easily and without reading the code, figure out how to flush all caches. perl -e 'use Koha::Caches; Koha::Caches::flush();' This is handy dandy when upgrading Koha or fiddling with configs.
This might work or might not :) flush is needed however. I'll keep posting followups if this doesn't.
Assigning to Olli-Antti as he provided the patch. Patch still applies, but I am not sure how to verify if it works correctly. Running the command from koha-shell gives no feedback, but no error either. Leaving for another tester. Something similar might already exist wrapped in commands like 'restart_all' on kohadevbox?
Created attachment 68468 [details] [review] Bug 18232 - Koha::Cache::flush - Simply flush all caches - Squashable1, fix pesky syspref cache issue After flushing Koha::Caches this flush() also removed the references to the singleton caches, forcing reinstating the cache connection. C4::Context had a hard-coded package variable referencing to the sysprefs cache. After flushing for the first time, the reference to the syspref cache was severed for Koha::Caches, but not to the C4::Context syspref cache, and flushing started to fail because the syspref cache was no longer referenced from Koha::Caches. The original change was made to try to get around the memcached cache expiration issues. And had this unintended side-effect.
Applied to master on my test kohadevbox cleanly and: perl -e 'use Koha::Caches; Koha::Caches::flush();' seems to run without any errors. As with Katrin, I could do with a test plan to check its working. I've tried poking around in memcached (using `memcached -vv` and `telnet localhost 11211` and then issuing stats commands), but I can't see much difference on a dev box to be honest. I'm guessing it needs a load of traffic sent to it to make the memcached caches fill up so that a flush is noticeable?
(In reply to Jon Knight from comment #5) > Applied to master on my test kohadevbox cleanly and: > > perl -e 'use Koha::Caches; Koha::Caches::flush();' > > seems to run without any errors. > > As with Katrin, I could do with a test plan to check its working. I've > tried poking around in memcached (using `memcached -vv` and `telnet > localhost 11211` and then issuing stats commands), but I can't see much > difference on a dev box to be honest. I'm guessing it needs a load of > traffic sent to it to make the memcached caches fill up so that a flush is > noticeable? You could try the following for a more detailed view of what's in the cache if you have the right tools installed: memdump --server localhost:11211 (might be memcdump on Debian) memcat --server localhost:11211 KOHADEV:syspref:syspref_opacnavright (might be memccat)
Do we still need this after Bug 20116, which added misc/bin/clear_cache.pl?