Skip to content

Commit

Permalink
fix(torii): only retrieve metadata for world (#2252)
Browse files Browse the repository at this point in the history
* fix: only retrieve metadata for world

* update comment
  • Loading branch information
lambda-0x authored Aug 4, 2024
1 parent e1c9597 commit 9834932
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/torii/core/src/processors/metadata_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(())
}
Expand Down

0 comments on commit 9834932

Please sign in to comment.