Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Super flusher? #109

Open
adixon opened this issue Jan 4, 2022 · 2 comments
Open

Super flusher? #109

adixon opened this issue Jan 4, 2022 · 2 comments

Comments

@adixon
Copy link

adixon commented Jan 4, 2022

I was recently cleaning up a site after an upgrade that had left an old flexmailer extension installed. In order to recognize the core flexmailer, there were a number of caches that needed clearing, but cv flush wouldn't work because it would error before getting to do anything useful. In the end, what I did that worked was:

  1. truncate civicrm_cache in sql
  2. manually delete the CachedCiviContainer files in templates_c

It occurs to me that this should be possible to script, and would be nice to include in the usual cv commands, as a super flush kind of action.

Make sense?

@herbdool
Copy link

Something like cv flush --all?

@gitressa
Copy link

gitressa commented Dec 20, 2024

I very much agree. Running cv flush should simply clear all cached tables and folders, like drush cache:rebuild does in Drupal. There are no levels, it just clears it all.

What would be the down side to not just clear all caches? Any theoretical extra seconds used to fill up some caches occasionally pales in comparison to the hours or even days CiviCRM users needlessly spend trying to complete an operation, such as upgrading from Drupal 7 to Drupal 10. I should know, I just did.

After completing what should have been a simple copying over of a separate CiviCRM database into Drupal 10 install, getting it running proved difficult. The /civicrm page was unavailable, so I couldn't access the rest of the admin pages, and when I did get limited access, I was getting cryptic errors all over the place. Much searching on the internet gave vague pointers in many directions, some about missing foreign keys, and other possible explanations.

I did of course run cv flush and drush cache:rebuild and assumed that all caches were of course cleaned out.

But by chance, earlier today, I found a mention of a page where I could "Reset Paths" and "Cleanup Caches" at /civicrm/admin/setting/updateConfigBackend.

And what do you know, additional old stuff was cleared out, and everything all of a sudden worked :)

I think this is a critical issue, which needs to get fixed as soon as possible, and cv flush should be improved, to clear all caches when run. It will save the users from wasting a lot of time in the long run.

Proposal

Expand the capabilities of cv flush to clear all cache tables, templates cache folders, reset all paths, etc. when run.

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

No branches or pull requests

3 participants