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 24114e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ List of changes between releases of Extension:AWS.
Minor features:
* Added "transcoded" zone to $wgAWSRepoZones.

Warnings fixed:
* Fixed harmless PHP warning in LocalCache::invalidate().

== AWS 0.13.1 ==

* Added support for MediaWiki 1.43.
Expand Down
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 24114e6

Please sign in to comment.