feat: add clear metadata action

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2022-10-10 12:45:44 +02:00
parent aabcca5059
commit 71f3c6b461
4 changed files with 32 additions and 0 deletions

View File

@ -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();

View File

@ -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);