From 9834932365efade1585176af0c017815542c9457 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Sun, 4 Aug 2024 09:54:05 +0530 Subject: [PATCH] fix(torii): only retrieve metadata for world (#2252) * fix: only retrieve metadata for world * update comment --- crates/torii/core/src/processors/metadata_update.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/torii/core/src/processors/metadata_update.rs b/crates/torii/core/src/processors/metadata_update.rs index a25d02f535..9bfea3e905 100644 --- a/crates/torii/core/src/processors/metadata_update.rs +++ b/crates/torii/core/src/processors/metadata_update.rs @@ -4,7 +4,7 @@ use anyhow::{Error, Result}; use async_trait::async_trait; use base64::engine::general_purpose; use base64::Engine as _; -use cainome::cairo_serde::{ByteArray, CairoSerde}; +use cainome::cairo_serde::{ByteArray, CairoSerde, Zeroable}; use dojo_world::contracts::world::WorldContractReader; use dojo_world::metadata::{Uri, WorldMetadata}; use reqwest::Client; @@ -68,9 +68,13 @@ where let db = db.clone(); let resource = *resource; - tokio::spawn(async move { - try_retrieve(db, resource, uri_str).await; - }); + + // Only retrieve metadata for the World contract. + if resource.is_zero() { + tokio::spawn(async move { + try_retrieve(db, resource, uri_str).await; + }); + } Ok(()) }