Fixed to sync the timeline only if the backend is available.

This commit is contained in:
Loic d'Anterroches 2009-05-27 18:04:33 +02:00
parent 7d84da4d7c
commit 6ef721d3a8

View File

@ -343,11 +343,13 @@ class IDF_Scm
$key = 'IDF_Scm:'.$project->shortname.':lastsync'; $key = 'IDF_Scm:'.$project->shortname.':lastsync';
if (null === ($res=$cache->get($key))) { if (null === ($res=$cache->get($key))) {
$scm = IDF_Scm::get($project); $scm = IDF_Scm::get($project);
if ($scm->isAvailable()) {
foreach ($scm->getChangeLog($scm->getMainBranch(), 25) as $change) { foreach ($scm->getChangeLog($scm->getMainBranch(), 25) as $change) {
IDF_Commit::getOrAdd($change, $project); IDF_Commit::getOrAdd($change, $project);
} }
$cache->set($key, true, (int)(Pluf::f('cache_timeout', 300)/2)); $cache->set($key, true, (int)(Pluf::f('cache_timeout', 300)/2));
} }
} }
}
} }