summaryrefslogtreecommitdiffstats
path: root/logic/net/HttpMetaCache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logic/net/HttpMetaCache.cpp')
-rw-r--r--logic/net/HttpMetaCache.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/logic/net/HttpMetaCache.cpp b/logic/net/HttpMetaCache.cpp
index eb13ee6b..4533a736 100644
--- a/logic/net/HttpMetaCache.cpp
+++ b/logic/net/HttpMetaCache.cpp
@@ -135,6 +135,17 @@ bool HttpMetaCache::updateEntry(MetaEntryPtr stale_entry)
return true;
}
+bool HttpMetaCache::evictEntry(MetaEntryPtr entry)
+{
+ if(entry)
+ {
+ entry->stale = true;
+ SaveEventually();
+ return true;
+ }
+ return false;
+}
+
MetaEntryPtr HttpMetaCache::staleEntry(QString base, QString resource_path)
{
auto foo = new MetaEntry;
@@ -228,6 +239,11 @@ void HttpMetaCache::SaveNow()
{
for (auto entry : group.entry_list)
{
+ // do not save stale entries. they are dead.
+ if(entry->stale)
+ {
+ continue;
+ }
QJsonObject entryObj;
entryObj.insert("base", QJsonValue(entry->base));
entryObj.insert("path", QJsonValue(entry->path));