diff options
author | Christian Schneider | 2007-10-08 14:34:55 +0000 |
---|---|---|
committer | Christian Schneider | 2007-10-08 14:34:55 +0000 |
commit | e402c1d2491cbac0243f0118c79c1c16f99f66a6 (patch) | |
tree | 3e8b2ac9d3e669f7efb6d7d71f624a8de9f5a230 | |
parent | dccc497d1bbe32ed96e41897e88a98fd55a9faf1 (diff) | |
download | itools-e402c1d2491cbac0243f0118c79c1c16f99f66a6.tar.gz itools-e402c1d2491cbac0243f0118c79c1c16f99f66a6.tar.bz2 itools-e402c1d2491cbac0243f0118c79c1c16f99f66a6.zip |
Fix get_cache() handling of failed urls with keepfailed option
-rw-r--r-- | it_url.class | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/it_url.class b/it_url.class index 833d4f9..65a3954 100644 --- a/it_url.class +++ b/it_url.class @@ -354,7 +354,7 @@ function get_cache($p = array()) $path = it_url::get_cache_filename($p); @mkdir(dirname($path)); - $age = time() - @filemtime($path); + $age = file_exists($path) ? (time() - @filemtime($path)) : 0; # expire forgotten locks $lockmtime = @filemtime("$path.lock"); @@ -367,8 +367,7 @@ function get_cache($p = array()) fclose($dummy); # Touch existing file to prevent locking other getters - if (file_exists($path)) - touch($path); + touch($path); EDC('getcache', "refresh", $p['url'], $path); if (($result = it_url::get($p['url'], $p['timeout']))) |