summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2007-02-05 17:03:32 +0000
committerUrban Müller2007-02-05 17:03:32 +0000
commitdb733f40091ce8675b53143dc461b310fc147290 (patch)
tree7bef7d791d4363b19caf289f85ef7d2dd8bf4376
parent220b1413fb29059e7f9450d93b64f1eb854a1311 (diff)
downloaditools-db733f40091ce8675b53143dc461b310fc147290.tar.gz
itools-db733f40091ce8675b53143dc461b310fc147290.tar.bz2
itools-db733f40091ce8675b53143dc461b310fc147290.zip
get_cache accepts it_error params
-rw-r--r--url.class5
1 files 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");
}