diff --git a/src/Enums/Global/PlatformCache.php b/src/Enums/Global/PlatformCache.php index 2fcdfca0..afd72ca9 100644 --- a/src/Enums/Global/PlatformCache.php +++ b/src/Enums/Global/PlatformCache.php @@ -24,10 +24,9 @@ enum PlatformCache: string implements PlatformCacheable case FEE = 'fee'; case DEPOSIT = 'deposit'; case RELEASE_DIFF = 'releaseDiff'; - case BLOCK_EVENT_COUNT = 'blockEventCount'; - case BLOCK_TRANSACTION = 'blockTransaction'; + case REFRESH_METADATA = 'refreshMetadata'; public function key(?string $suffix = null, ?string $network = null): string { diff --git a/src/GraphQL/Schemas/Primary/Substrate/Mutations/RefreshMetadataMutation.php b/src/GraphQL/Schemas/Primary/Substrate/Mutations/RefreshMetadataMutation.php index 0e52afd9..0eab8020 100644 --- a/src/GraphQL/Schemas/Primary/Substrate/Mutations/RefreshMetadataMutation.php +++ b/src/GraphQL/Schemas/Primary/Substrate/Mutations/RefreshMetadataMutation.php @@ -3,6 +3,7 @@ namespace Enjin\Platform\GraphQL\Schemas\Primary\Substrate\Mutations; use Closure; +use Enjin\Platform\Enums\Global\PlatformCache; use Enjin\Platform\Exceptions\PlatformException; use Enjin\Platform\GraphQL\Base\Mutation; use Enjin\Platform\GraphQL\Schemas\Primary\Substrate\Traits\HasEncodableTokenId; @@ -76,9 +77,9 @@ public function resolve( SerializationServiceInterface $serializationService, MetadataService $metadataService, ): mixed { - $key = 'RefreshMetadataMutation' - . ':' . ($collectionId = Arr::get($args, 'collectionId')) - . ':' . ($tokenId = $this->encodeTokenId($args)); + $key = PlatformCache::REFRESH_METADATA->key( + ($collectionId = Arr::get($args, 'collectionId')) . ':' . ($tokenId = $this->encodeTokenId($args)) + ); if (RateLimiter::tooManyAttempts($key, config('enjin-platform.sync_metadata.refresh_max_attempts'))) { throw new PlatformException( __('enjin-platform::error.too_many_requests', ['num' => RateLimiter::availableIn($key)])