clockwork icon indicating copy to clipboard operation
clockwork copied to clipboard

FileStorage->cleanup() missing oldest file

Open ssnepenthe opened this issue 4 years ago • 0 comments

I noticed this on my own custom implementation but just confirmed the same is happening on a fresh laravel install with the latest version of clockwork.

When using file storage with an expiration of 0 and calling ->cleanup(true) (i.e. running php artisan clockwork:clean --all), the index is cleared out and all of the metadata files are removed except for the oldest one.

Expected behavior is for all metadata files to be removed.

To reproduce, create a fresh laravel install, install clockwork, run the dev server, visit the site and refresh a few times to generate a few metadata files and then inspect the storage/clockwork directory.

Screen Shot 2021-08-03 at 8 58 27 PM Screen Shot 2021-08-03 at 8 58 40 PM

Now run php artisan clockwork:clean --all and re-inspect the storage/clockwork directory:

Screen Shot 2021-08-03 at 9 01 20 PM Screen Shot 2021-08-03 at 9 01 31 PM

ssnepenthe avatar Aug 04 '21 04:08 ssnepenthe