Utils: Remove PresistentStoreCache

It turns out caching the information is unreliable due to a variety of reasons.
We remove the cache for now as its less dangerous than trying to fix each
use case.

Change-Id: I8238166486a2fb29c101f700af1c8d7e4ad7a172
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-03-12 14:24:06 +01:00
parent 07399dfb0c
commit 4e8bdd610b
8 changed files with 12 additions and 192 deletions

View File

@@ -19,7 +19,6 @@
#include <utils/algorithm.h>
#include <utils/mimeutils.h>
#include <utils/persistentcachestore.h>
#include <utils/process.h>
#include <QReadLocker>
@@ -201,20 +200,10 @@ static bool isUsableHelper(QHash<FilePath, bool> *cache, const QString &keyStrin
auto it = cache->find(python);
if (it == cache->end()) {
const Key key = keyFromString(keyString);
const auto store = PersistentCacheStore::byKey(key);
if (store && store->value(keyFromString(python.toString())).toBool()) {
cache->insert(python, true);
return true;
}
Process process;
process.setCommand({python, QStringList{"-m", commandArg, "-h"}});
process.runBlocking();
const bool usable = process.result() == ProcessResult::FinishedWithSuccess;
if (usable) {
Store newStore = store.value_or(Store{});
newStore.insert(keyFromString(python.toString()), true);
PersistentCacheStore::write(key, newStore);
}
it = cache->insert(python, usable);
}
return *it;