contao / installation-bundle

[READ-ONLY] Contao Installation Bundle
GNU Lesser General Public License v3.0
8 stars 9 forks source link

Skip exception when deleting cache directories #60

Closed aschempp closed 7 years ago

aschempp commented 7 years ago

Sometimes I got exceptions in the install tool because not all cache files were removed. I think we should ignore that, as it's not gonna be a major issue and breaks the application.

leofeyer commented 7 years ago

Are you sure that this does not result in an incomplete cache?

aschempp commented 7 years ago

I'm not… but I had no issues just ignoring it, pretty sure the error happens because of invisible files or something similar that are irrelevant…

fritzmg commented 7 years ago

cache:clear of Symfony first renames the cache folder and then deletes it. Shouldn't InstallationController::purgeSymfonyCache do the same?

leofeyer commented 7 years ago

It probably should.

aschempp commented 7 years ago

Very good idea! Will adjust the PR

aschempp commented 7 years ago

PR is updated

fritzmg commented 7 years ago

New method is surely better :). However it does not solve your original problem, does it? An exception might still occur when removing the old cache dir. (At least I frequently experience that even on the console due to operating system shenanigans.)

Though now it's less likely do occur.

aschempp commented 7 years ago

You're right. But I guess in that case we should actually show the message?

fritzmg commented 7 years ago

Well, you could also ignore it like in your original PR. Because the next time purgeSymfonyCache is called, the old cache directory will be tried to delete anyway, before the current cache directory is renamed. (Though what if an error occurs then again?)

leofeyer commented 7 years ago

Thank you @aschempp.

fritzmg commented 7 years ago

Btw. shouldn't the same be added to the manager-bundle? Currently, it simply deletes the prod folder: https://github.com/contao/manager-bundle/blob/4.4.2/src/Composer/ScriptHandler.php#L60

aschempp commented 7 years ago

That's probably a different thing because the ScriptHandler does not run within the Symfony application.