MCPcopy Create free account
hub / github.com/Snapchat/Valdi / updateAssetLocation

Method updateAssetLocation

valdi/src/valdi/runtime/Resources/AssetsManager.cpp:439–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439void AssetsManager::updateAssetLocation(const AssetKey& assetKey,
440 const Ref<ManagedAsset>& managedAsset,
441 const Result<AssetLocation>& assetLocation) {
442 SC_ASSERT(managedAsset->getState() == AssetStateResolvingLocation);
443 if constexpr (kEnableAssetsLogs) {
444 if (assetLocation) {
445 VALDI_INFO(_logger, "Updated asset location of '{}'", assetKey);
446 }
447 }
448
449 if (!assetLocation) {
450 VALDI_WARN(_logger, "Failed to update asset location of '{}': {}", assetKey, assetLocation.error());
451 }
452
453 if (assetLocation) {
454 managedAsset->setState(AssetStateReady);
455 managedAsset->setResolvedAssetLocation({assetLocation.value()});
456 } else {
457 managedAsset->setState(AssetStateFailedPermanently);
458 managedAsset->setResolvedAssetLocation(assetLocation.error());
459 }
460}
461
462void AssetsManager::onLoadingRemoteResourcesCompleted(const AssetKey& assetKey,
463 const Result<Ref<RemoteModuleResources>>& result,

Callers

nothing calls this directly

Calls 5

getStateMethod · 0.65
errorMethod · 0.65
valueMethod · 0.65
setStateMethod · 0.45

Tested by

no test coverage detected