From e402c1d2491cbac0243f0118c79c1c16f99f66a6 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 8 Oct 2007 14:34:55 +0000 Subject: Fix get_cache() handling of failed urls with keepfailed option --- it_url.class | 5 ++--- 1 file 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']))) -- cgit v1.2.3