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

[Question] Cleanup temporary files #524

Open
cristiansoftlead opened this issue Jul 29, 2024 · 0 comments
Open

[Question] Cleanup temporary files #524

cristiansoftlead opened this issue Jul 29, 2024 · 0 comments

Comments

@cristiansoftlead
Copy link

Hello,

I try to use cleanupTemporaryFiles() but it doesn't work. I have a job that runs in the background using workers and I tried to put this method inside onProgress ( there is no documentation how to use it ).

$ffmpeg->onProgress(function ($percent) {
            $this->video->hls_progress = $percent;
            $this->video->save();
            
            if((int)$percent === 100) {
                try {
                    FFMpeg::cleanupTemporaryFiles();
                } catch(\Exception) {}
            }
        });

But this isn't working....the temporary files are still there.
Should I just chain this method here, like this, and he will know to delete temp files only after everything is done?

$ffmpeg = FFMpeg::fromDisk('s3')
            ->open($this->video->url)
            ->exportForHLS()
            ->toDisk('s3')
            ->cleanupTemporaryFiles();

Thank you

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

1 participant