diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-10-10 12:45:44 +0200 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2022-10-10 12:48:25 +0200 |
commit | 71f3c6b461eb296a3d1604e3534c9a4ab3d43397 (patch) | |
tree | a6b5689463660ceee3e3f3ddc82e766c871c03b3 /launcher/net | |
parent | aabcca505939b481f5bf808ee12deb26aec30d0f (diff) | |
download | PrismLauncher-71f3c6b461eb296a3d1604e3534c9a4ab3d43397.tar.gz PrismLauncher-71f3c6b461eb296a3d1604e3534c9a4ab3d43397.tar.bz2 PrismLauncher-71f3c6b461eb296a3d1604e3534c9a4ab3d43397.zip |
feat: add clear metadata action
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/net')
-rw-r--r-- | launcher/net/HttpMetaCache.cpp | 12 | ||||
-rw-r--r-- | launcher/net/HttpMetaCache.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/launcher/net/HttpMetaCache.cpp b/launcher/net/HttpMetaCache.cpp index 9606ddb6..42198b71 100644 --- a/launcher/net/HttpMetaCache.cpp +++ b/launcher/net/HttpMetaCache.cpp @@ -162,6 +162,18 @@ auto HttpMetaCache::evictEntry(MetaEntryPtr entry) -> bool return true; } +void HttpMetaCache::evictAll() +{ + for (QString& base : m_entries.keys()) { + EntryMap& map = m_entries[base]; + qDebug() << "Evicting base" << base; + for (MetaEntryPtr entry : map.entry_list) { + if (!evictEntry(entry)) + qWarning() << "Unexpected missing cache entry" << entry->basePath; + } + } +} + auto HttpMetaCache::staleEntry(QString base, QString resource_path) -> MetaEntryPtr { auto foo = new MetaEntry(); diff --git a/launcher/net/HttpMetaCache.h b/launcher/net/HttpMetaCache.h index c0b12318..2a07d65a 100644 --- a/launcher/net/HttpMetaCache.h +++ b/launcher/net/HttpMetaCache.h @@ -113,6 +113,7 @@ class HttpMetaCache : public QObject { // evict selected entry from cache auto evictEntry(MetaEntryPtr entry) -> bool; + void evictAll(); void addBase(QString base, QString base_root); |