mage2tv / magento-cache-clean

A faster drop in replacement for bin/magento cache:clean with file watcher
BSD 3-Clause "New" or "Revised" License
528 stars 61 forks source link

Observe var/cache-clean-config.json for changes #38

Closed Vinai closed 5 years ago

Vinai commented 5 years ago

When the file var/cache-clean-config.json is present, the watcher reads the available modules and themes from it. When a new module is added and the dump file is recreated, then the watcher should pick up the change without having to be restarted.

Vinai commented 5 years ago

Description of the desired behavior:

If there is a dump file:

If there is no dump file:

Switch between the two behaviors on the fly without requiring a restart so it "just works".

Vinai commented 5 years ago

Implementation options:

  1. Always observe both app/etc/config.php and var/cache-clean-config.json for changes and only distinguish how to react depending on the presence of the cache-clean-config.json file.
  2. Only observe one of the two files at a time and switch from one to the other as appropriate whenever a change is registered.

Keeping simplicity in mind, option 1 seems more robust.

Vinai commented 5 years ago

Implemented and released in 0.0.42.