Trying to fix the problem where if the cache is built up, then until you refresh...
[viewsvn.git] / global.php
index 4d101b58e8e86e141d50f8776849345cded1f76a..8d2faacc30839d2c7eedacb1cd65b54144a6f3f1 100644 (file)
@@ -26,7 +26,6 @@ $dochooser = ((defined('PATH_OVERRIDE') AND PATH_OVERRIDE == 1) ? false : true);
 if ($dochooser)
 {
        $controller = new Controller(Paths::init());
-       $viewsvn->maincontrol =& $controller;
        
        if (isset($viewsvn->in['rebuild']) AND $viewsvn->in['rebuild'] == 1 AND $viewsvn->get('debug') == true)
        {
@@ -34,8 +33,14 @@ if ($dochooser)
        }
        else
        {
-               $controller->cachev->exec_build();
+               if ($controller->cachev->exec_build())
+               {
+                       unset($controller);
+                       $controller = new Controller(Paths::init());
+               }
        }
+       
+       $viewsvn->maincontrol =& $controller;
 }
 
 $fetchtemplates[] = 'header';