diff options
author | Urban Müller | 2007-02-05 17:03:32 +0000 |
---|---|---|
committer | Urban Müller | 2007-02-05 17:03:32 +0000 |
commit | db733f40091ce8675b53143dc461b310fc147290 (patch) | |
tree | 7bef7d791d4363b19caf289f85ef7d2dd8bf4376 /url.class | |
parent | 220b1413fb29059e7f9450d93b64f1eb854a1311 (diff) | |
download | itools-db733f40091ce8675b53143dc461b310fc147290.tar.gz itools-db733f40091ce8675b53143dc461b310fc147290.tar.bz2 itools-db733f40091ce8675b53143dc461b310fc147290.zip |
get_cache accepts it_error params
Diffstat (limited to 'url.class')
-rw-r--r-- | url.class | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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"); } |