You are here

function advagg_install_delete_empty_file_if_stale in Advanced CSS/JS Aggregation 7.2

Callback to delete files if size == 0 and modified more than 60 seconds ago.

Parameters

string $uri: Location of the file to check.

2 string references to 'advagg_install_delete_empty_file_if_stale'
advagg_remove_temp_files in ./advagg.cache.inc
Delete leftover temp files.
advagg_update_7204 in ./advagg.install
Remove empty temporary files left behind by AdvAgg.

File

./advagg.install, line 2733
Handles Advanced Aggregation installation and upgrade tasks.

Code

function advagg_install_delete_empty_file_if_stale($uri) {

  // Set stale file threshold to 60 seconds.
  if (is_file($uri) && filesize($uri) < 3 && REQUEST_TIME - filemtime($uri) > 60) {
    file_unmanaged_delete($uri);
  }
}