From f815b011c3d02c486e29b682886b6eb8583bd8c8 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 18 Apr 2020 16:27:57 +0200 Subject: [PATCH] [Cache] fix FilesystemTagAwareAdapter failing when a tag link preexists --- .../Component/Cache/Adapter/FilesystemTagAwareAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Cache/Adapter/FilesystemTagAwareAdapter.php b/src/Symfony/Component/Cache/Adapter/FilesystemTagAwareAdapter.php index d9a1ad39ac..2ce9eeb977 100644 --- a/src/Symfony/Component/Cache/Adapter/FilesystemTagAwareAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/FilesystemTagAwareAdapter.php @@ -107,7 +107,7 @@ class FilesystemTagAwareAdapter extends AbstractTagAwareAdapter implements Prune $file = $this->getFile($id); - if (!@symlink($file, $this->getFile($id, true, $tagFolder))) { + if (!@symlink($file, $tagLink = $this->getFile($id, true, $tagFolder)) && !is_link($tagLink)) { @unlink($file); $failed[] = $id; }