Cleaner logo
Cleaner

The Cleaner module allows the admin to set a schedule for clearing caches, watchdog, and old sessions.

There are still times and/or cache tables that don't get cleared in any of those scenarios. Many sites will not be impacted by this, but a few will (just search on drupal.org and you will see many posts from people having problems).

Before you dismiss this module as "silly," which I did for a while after writing it, consider an actual experience. I maintain a site that is based on Panels, NodeQueue, and Views. In this set up, the cache entries can get very large after some time. MySQL has a parameter ("max_allowed_packet") that limits how much data can be read in. If this limit is exceeded, MySQL does not throw an error, rather it just provides what data it could read. With no error indication, the site just goes merrily on its way with what was given to it. In this case both the panel definition and NodeQueue contents went haywire. Clearing the cache resolved the issue for the moment.

Then I remembered this module that I had written and dismissed as "silly" after getting it working. Now, I will admit that the hooks provided here probably are "silly" but I had included them originally, so they are still there. I don't know why anyone would use them, but if you want, knock yourself out.

Important changes:

8.x-1.x branch is deprecated and no longer be supported
8.x-2.x branch is created and going to have the initial release soon

The main change comparing to 1.x is using Event based system instead of hook + services, so if you're still using the hook_cleaner_run() - please change it to the EventSubscriber.

Found a bug or have a new feature idea?

Welcome -> Create an issue queue

Project information

Releases