Added caching of the database, attachments and uploaded files to avoid calculating them each time.

This commit is contained in:
Loic d'Anterroches
2010-05-17 12:17:02 +02:00
parent a91ce1600f
commit c534894995
2 changed files with 36 additions and 13 deletions

View File

@@ -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);
}