mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:16:16 +02:00
Add proper cache checking to GetAssetMapping
This commit is contained in:
parent
bc99e871e1
commit
cf9d4c256a
1 changed files with 9 additions and 0 deletions
|
@ -40,6 +40,15 @@ void GetMappingRequest::start() {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto assetClient = DependencyManager::get<AssetClient>();
|
auto assetClient = DependencyManager::get<AssetClient>();
|
||||||
|
|
||||||
|
// Check cache
|
||||||
|
auto it = assetClient->_mappingCache.constFind(_path);
|
||||||
|
if (it != assetClient->_mappingCache.constEnd()) {
|
||||||
|
_hash = it.value();
|
||||||
|
emit finished(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
assetClient->getAssetMapping(_path, [this, assetClient](bool responseReceived, AssetServerError error, QSharedPointer<ReceivedMessage> message) {
|
assetClient->getAssetMapping(_path, [this, assetClient](bool responseReceived, AssetServerError error, QSharedPointer<ReceivedMessage> message) {
|
||||||
// read message
|
// read message
|
||||||
_error = error;
|
_error = error;
|
||||||
|
|
Loading…
Reference in a new issue