| 437 | } |
| 438 | |
| 439 | void 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 | |
| 462 | void AssetsManager::onLoadingRemoteResourcesCompleted(const AssetKey& assetKey, |
| 463 | const Result<Ref<RemoteModuleResources>>& result, |
nothing calls this directly
no test coverage detected