Skip to content
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

Wrong console output if no files are deleted #38

Closed
briavers opened this issue Apr 24, 2020 · 2 comments
Closed

Wrong console output if no files are deleted #38

briavers opened this issue Apr 24, 2020 · 2 comments

Comments

@briavers
Copy link

When no files are deleted the console says
Cleaning directories...
Deleted 30 file(s) from storage/app/public/tmp/uploads.
Deleted 0 directory(ies) from storage/app/public/tmp/uploads.
All done!

<?php

use Spatie\DirectoryCleanup\Policies\DeleteEverything;

return [

    'directories' => [

        /*
         * Here you can specify which directories need to be cleanup. All files older than
         * the specified amount of minutes will be deleted.
         */


        'storage/app/public/tmp/uploads' => [
            'deleteAllOlderThanMinutes' => 30,
        ],

    ],

    /*
     * If a file is older than the amount of minutes specified, a cleanup policy will decide if that file
     * should be deleted. By default every file that is older that the specified amount of minutes
     * will be deleted.
     *
     * You can customize this behaviour by writing your own clean up policy.  A valid policy
     * is any class that implements `Spatie\DirectoryCleanup\Policies\CleanupPolicy`.
     */
    'cleanup_policy' => DeleteEverything::class,
];

If i put 'deleteAllOlderThanMinutes' => 60, then the same is said only saying deleted 60 files

I don't need the console output so is no big issue for me but just wanted to let you know

@voydz
Copy link

voydz commented May 1, 2020

Hey,

the issue might be related to #36. This PR was merged (which seems to fix your issue). But it has not been released to packagist, yet.

It would be awesome if some guys from spatie could do it? @freekmurze maybe? :)

best regards

@freekmurze
Copy link
Member

Fix is now tagged. 👍

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