Fixed bug in the cache resulting in errors in the tree view.

The cache was not per project but one cache for all the projects.
dev
Loic d'Anterroches 2009-01-23 15:06:57 +01:00
parent 657dd339a1
commit 38ac214d55
1 changed files with 4 additions and 2 deletions

View File

@ -112,7 +112,8 @@ class IDF_Views_Source
return new Pluf_HTTP_Response_Redirect($url); return new Pluf_HTTP_Response_Redirect($url);
} }
$cache = Pluf_Cache::factory(); $cache = Pluf_Cache::factory();
$key = 'IDF_Views_Source::treeBase:'.$commit.'::'; $key = sprintf('Project:%s::IDF_Views_Source::treeBase:%s::',
$request->project->id, $commit);
if (null === ($res=$cache->get($key))) { if (null === ($res=$cache->get($key))) {
$res = new Pluf_Template_ContextVars($scm->filesAtCommit($commit)); $res = new Pluf_Template_ContextVars($scm->filesAtCommit($commit));
$cache->set($key, $res); $cache->set($key, $res);
@ -183,7 +184,8 @@ class IDF_Views_Source
$tree_in = in_array($commit, $branches); $tree_in = in_array($commit, $branches);
try { try {
$cache = Pluf_Cache::factory(); $cache = Pluf_Cache::factory();
$key = 'IDF_Views_Source::tree:'.$commit.'::'.$request_file; $key = sprintf('Project:%s::IDF_Views_Source::tree:%s::%s',
$request->project->id, $commit, $request_file);
if (null === ($res=$cache->get($key))) { if (null === ($res=$cache->get($key))) {
$res = new Pluf_Template_ContextVars($scm->filesAtCommit($commit, $request_file)); $res = new Pluf_Template_ContextVars($scm->filesAtCommit($commit, $request_file));
$cache->set($key, $res); $cache->set($key, $res);