I frequently see errors like the following when Boost is trying to delete a file that doesn't exist:

unlink(FILENAME_HERE): No such file or directory

The offending code is in boost_expire_cache():

if (unlink($filename)) {
  boost_log('Removed !file from the boost cache.', array('!file' => $filename), WATCHDOG_DEBUG);
}
else {
  boost_log('Could not delete !file from the boost cache. Check file permissions.', array('!file' => $filename), WATCHDOG_WARNING);
}

I propose simply checking if the file exists before attempting to delete it. If it's not there, that's just fine and no warning needs to be thrown or watchdog message logged.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelstein created an issue. See original summary.

joelstein’s picture

Status: Active » Needs review
FileSize
1016 bytes

Here's a patch which uses is_file() to check that the file exists and is a file.