Skip to content

Commit

Permalink
Fix "No such file or directory" warning in LocalCache::invalidate()
Browse files Browse the repository at this point in the history
If cache file doesn't exist, we shouldn't try to unlink() it.
  • Loading branch information
edwardspec committed Jan 1, 2025
1 parent 0d145b0 commit 67d9a90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/AmazonS3LocalCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static function postDownloadLogic( &$file ) {
public static function invalidate( $virtualPath ) {
$localPath = self::findLocalPath( $virtualPath );

if ( $localPath ) {
if ( $localPath && file_exists( $localPath ) ) {
// TODO: graceful "mark as expired, delete later".
// TODO: delete on all webservers (not just this one).
$file = new TempFSFile( $localPath );
Expand Down

0 comments on commit 67d9a90

Please sign in to comment.