spatie/laravel-personal-data-export

rmdir(C:\\Windows\\TEMP\\189362675-0830427001568696710): Directory not empty

vishalinfyom opened this issue · 1 comments

while dispatching dispatch(new CreatePersonalDataExportJob($user)); error occurs from line
$temporaryDirectory->delete();

 public function handle()
    {
        $temporaryDirectory = (new TemporaryDirectory())->create();

        $personalDataSelection = $this->selectPersonalData($temporaryDirectory);

        event(new PersonalDataSelected($personalDataSelection, $this->user));

        $zipFilename = $this->zipPersonalData($personalDataSelection, $this->getDisk(), $temporaryDirectory);

        $temporaryDirectory->delete();

        event(new PersonalDataExportCreated($zipFilename, $this->user));

        $this->mailZip($zipFilename);
    }

Fixed