Added caching of the database, attachments and uploaded files to avoid calculating them each time.
This commit is contained in:
@@ -366,12 +366,12 @@ class IDF_Project extends Pluf_Model
|
||||
public function getRepositorySize($force=false)
|
||||
{
|
||||
$last_eval = $this->getConf()->getVal('repository_size_check_date', 0);
|
||||
if (!$force and $last_eval > time()-86400) {
|
||||
if (!$force and $last_eval > time()-172800) {
|
||||
return $this->getConf()->getVal('repository_size', -1);
|
||||
}
|
||||
$this->getConf()->setVal('repository_size_check_date', time());
|
||||
$scm = IDF_Scm::get($this);
|
||||
$this->getConf()->setVal('repository_size', $scm->getRepositorySize());
|
||||
$this->getConf()->setVal('repository_size_check_date', time());
|
||||
return $this->getConf()->getVal('repository_size', -1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user