aboutsummaryrefslogtreecommitdiff
path: root/src/cachehandler.cpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-02-18 17:44:17 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-02-18 11:23:23 +0100
commit6e127eb49d6a71e4d05cbb2e29fc164e718a903c (patch)
treea11e635dd5ae465c1173fe85e992c8e618fe2e7c /src/cachehandler.cpp
parentfb230927ab64ebcb4f2fe75f33658127421738b9 (diff)
Add unlimited cache life option
Diffstat (limited to 'src/cachehandler.cpp')
-rw-r--r--src/cachehandler.cpp4
1 files changed, 4 insertions, 0 deletions
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<QString> 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))
{