diff options
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"); } |