From 6e127eb49d6a71e4d05cbb2e29fc164e718a903c Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Thu, 18 Feb 2021 17:44:17 +1100 Subject: Add unlimited cache life option --- src/cachehandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cachehandler.cpp') diff --git a/src/cachehandler.cpp b/src/cachehandler.cpp index b2708df..d9c8836 100644 --- a/src/cachehandler.cpp +++ b/src/cachehandler.cpp @@ -77,10 +77,14 @@ int CacheHandler::size() // Clears expired pages out of cache void CacheHandler::clean() { + // Don't clean anything if we have unlimited item life. + if (kristall::options.cache_unlimited_life) return; + // Find list of keys to delete std::vector vec; for (auto&& i : this->page_cache) { + // Check if this cache item is expired. if (QDateTime::currentDateTime() > i.second->time_cached .addSecs(kristall::options.cache_life * 60)) { -- cgit v1.2.3