[Cache] fix FilesystemTagAwareAdapter failing when a tag link preexists

This commit is contained in:
Nicolas Grekas 2020-04-18 16:27:57 +02:00
parent 39a7ee1a61
commit f815b011c3

View File

@ -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;
}