diff options
-rw-r--r-- | it_url.class | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/it_url.class b/it_url.class index cb0f0c9..127bd01 100644 --- a/it_url.class +++ b/it_url.class @@ -464,16 +464,16 @@ function _waitforpath($p) $p += array('sleeptime' => 0.1); # seconds to wait per pass # wait until cache is ready, then read from cache - for ($maxpasses = $p['timeout'] / $p['sleeptime'], $passes = 0; (@filesize($p['path']) <= 0) && ($passes < $maxpasses); ++$passes) + for ($maxpasses = $p['timeout'] / $p['sleeptime'], $passes = 0; (($size = @filesize($p['path'])) === 0) && ($passes < $maxpasses); ++$passes) { usleep($p['sleeptime'] * 1000000); clearstatcache(); } - if ($passes < $maxpasses) + if ($size) $result = $p['path']; else if ($p['safety'] == 1) - it::error("timeout in it_url::get_cache(): url={$p['url']}, passes=$passes, maxpasses=$maxpasses, path={$p['path']}"); + it::error(($passes < $maxpasses ? "error getting url" : "timeout") . " in it_url::get_cache(): url={$p['url']}, passes=$passes, maxpasses=$maxpasses, path={$p['path']}"); return $result; } |