Add proper cache checking to GetAssetMapping

This commit is contained in:
Ryan Huffman 2016-03-08 10:10:48 -08:00
parent bc99e871e1
commit cf9d4c256a

View file

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