From db733f40091ce8675b53143dc461b310fc147290 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 5 Feb 2007 17:03:32 +0000 Subject: get_cache accepts it_error params --- url.class | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/url.class b/url.class index 83fa4ca..105a28b 100644 --- a/url.class +++ b/url.class @@ -336,10 +336,11 @@ function get_cache_filename($p) * @safety value 0 means dont generate alert, value 1 means generate alerts on timeouts and failures * @keepfailed keep old versions of files if download fails (sending alerts conservatively) * @cachedir directory to store cache files in. NO TRAILING SLASH + * @it_error parameters for it_error */ function get_cache($p = array()) { - $p += array('timeout'=>10000, 'maxage'=>86400, 'cleanbefore'=>7200, 'safety'=>1, 'cachedir'=>$GLOBALS['ULTRAHOME']."/var/urlcache"); + $p += array('timeout'=>10000, 'maxage'=>86400, 'cleanbefore'=>7200, 'safety'=>1, 'cachedir'=>$GLOBALS['ULTRAHOME']."/var/urlcache", 'it_error'=>array()); $path = it_url::get_cache_filename($p); @mkdir(dirname($path)); @@ -368,7 +369,7 @@ function get_cache($p = array()) if (($parts = parse_url($p['url'])) === false) it::error('malformed url ' . $p['url']); if ($p['safety'] == 1 && !$result) - it::error(array('title'=>"get_cache: download failures on {$p['url']}", 'id'=>$parts['host'])); # send err only if multi failure + it::error($p['it_error'] + array('title'=>"get_cache: download failures on {$p['url']}", 'id'=>$parts['host'])); # send err only if multi failure @unlink("$path.lock"); } -- cgit v1.2.3