Skip to content

Support for Mage2 TV Cache Clean Tool #258

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

Closed
sprankhub opened this issue Nov 3, 2020 · 4 comments
Closed

Support for Mage2 TV Cache Clean Tool #258

sprankhub opened this issue Nov 3, 2020 · 4 comments

Comments

@sprankhub
Copy link
Contributor

This is related to mage2tv/magento-cache-clean#82.

We enjoy using the Mage2 TV Cache Clean Tool for quite some time. We configured PHPStorm to run the watcher during startup, so that we nearly never have to manually clean the cache again. We now switched to Warden and our process does not work as smooth as before. It is of course possible to run the watcher inside the container, but it is a manual process, which is inconvenient. Do you see any way to better support the cache clean watcher out of the box? I can think of the following options:

  1. Expose the DNS and ports of Redis on the host machine, so that the cache clean tool can connect to Redis on the host machine. This is pretty much what @Vinai also proposed in his comment.
  2. Add a config setting, which allows to enable the cache clean watcher in the container, so that whenever warden env up is called, the cache clean watcher simply runs. However, since it sometimes crashes, redirecting the output to a log file would be helpful.

I tend to more like option 1, because it looks easier to do, but this may be a false assumption.

@jantzenw
Copy link

jantzenw commented Nov 5, 2020

@sprankhub can you run warden env exec php-fpm vendor/bin/cache-clean.js -w from the host machine instead of vendor/bin/cache-clean.js -w?

@sprankhub
Copy link
Contributor Author

You are of course absolutely right - this will even show the output. Thanks @jantzenw!

@sprankhub
Copy link
Contributor Author

For those wondering how this can be configured in PHPStorm:

image

Just ignore the warning about the missing script.

@sebastian-ehrling
Copy link
Contributor

I think it is to complicated to add this configuration in every local project.
For me the better way is to add the cache cleaner to my global composer and add the following script in my own global binary directory.

  1. composer global require --dev mage2tv/magento-cache-clean
  2. Create a global directory. For example /Users/[myuser]/bin
  3. Add a new file in this directory: mageWatch and make them executable
  4. Add the following content to this file:
    $HOME/.composer/vendor/bin/cache-clean.js --watch
  5. Add the new directory to your PATH Variable
  6. Open warden shell and run the new Command mageWatch

now you can run this script in every project

Vinai added a commit to mage2tv/magento-cache-clean that referenced this issue Nov 9, 2020
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