function onDownloadProgress($current, $max) { if ($max) { if (duration::since($lastupdate) > 5) { // only update every 5 secs $this->setState(LdwpJob::STATE_RUNNING, $current, $max); } } }