[entropy.db.cache] disable in-RAM cache if total memory is less than 4G

This commit is contained in:
Fabio Erculiani
2014-01-03 14:54:04 +01:00
parent ee48b812ed
commit d03466ea10
+6 -1
View File
@@ -13,6 +13,8 @@ import weakref
from entropy.core import Singleton
import entropy.tools
class EntropyRepositoryCacher(Singleton):
"""
@@ -88,4 +90,7 @@ class EntropyRepositoryCachePolicies(object):
ALL,
) = range(2)
DEFAULT_CACHE_POLICY = ALL
if entropy.tools.total_memory() >= 4000:
DEFAULT_CACHE_POLICY = ALL
else:
DEFAULT_CACHE_POLICY = NONE