mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 18:09:59 +03:00
GH-853 evict asset index files from cache when they don't parse
This commit is contained in:
parent
eae544f0eb
commit
3b6574181e
3 changed files with 22 additions and 0 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue