瀏覽代碼

New option: apc_cache.query_ttl (defaults to 3600s)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1174 a333f486-631f-4898-b8df-5754b55c2be0
romainq 14 年之前
父節點
當前提交
8e975682b1
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      core/metamodel.class.php

+ 4 - 2
core/metamodel.class.php

@@ -221,7 +221,8 @@ abstract class MetaModel
 	private static $m_bSkipCheckToWrite = false;
 	private static $m_bSkipCheckExtKeys = false;
 
-   private static $m_bUseAPCCache = false;
+	private static $m_bUseAPCCache = false;
+	private static $m_iQueryCacheTTL = 3600;
 
 	private static $m_bQueryCacheEnabled = false;
 	private static $m_bTraceQueries = false;
@@ -1843,7 +1844,7 @@ abstract class MetaModel
 				if (self::$m_bUseAPCCache)
 				{
 					$oKPI = new ExecutionKPI();
-					apc_store($sOqlAPCCacheId, $oSelect);
+					apc_store($sOqlAPCCacheId, $oSelect, self::$m_iQueryCacheTTL);
 					$oKPI->ComputeStats('Query APC (store)', $sOqlQuery);
 				}
 
@@ -3625,6 +3626,7 @@ abstract class MetaModel
 										&& self::$m_oConfig->Get('apc_cache.enabled')
 										&& function_exists('apc_fetch')
 										&& function_exists('apc_store');
+		self::$m_iQueryCacheTTL = self::$m_oConfig->Get('apc_cache.query_ttl');
 
 		// Note: load the dictionary as soon as possible, because it might be
 		//       needed when some error occur