Skip to content

Commit

Permalink
fix: special use of das-metadata-json in triton-build
Browse files Browse the repository at this point in the history
  • Loading branch information
kespinola committed Aug 12, 2024
1 parent 656c0c8 commit dd8103a
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 16 deletions.
35 changes: 35 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"digital_asset_types",
"integration_tests",
"metaplex-rpc-proxy",
"metadata_json",
"migration",
"nft_ingester",
"ops",
Expand Down Expand Up @@ -48,6 +49,7 @@ cargo-lock = "9.0.0"
chrono = "0.4.19"
clap = "4.2.2"
das-core = { path = "core" }
das-metadata-json = { path = "metadata_json" }
das-backfill = { path = "backfill" }
das_api = { path = "das_api" }
derive_more = { version = "0.99.17" }
Expand Down
2 changes: 1 addition & 1 deletion core/src/metadata_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub async fn create_download_metadata_notifier(
})
}

#[derive(Parser, Clone, Debug)]
#[derive(Parser, Clone, Debug, PartialEq, Eq)]
pub struct MetadataJsonDownloadWorkerArgs {
/// The number of worker threads
#[arg(long, env, default_value = "25")]
Expand Down
9 changes: 2 additions & 7 deletions grpc-ingest/src/ingester.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
crate::{
config::{ConfigIngester, ConfigIngesterDownloadMetadata},
download_metadata::{TASK_TYPE},
download_metadata::TASK_TYPE,
postgres::{create_pool as pg_create_pool, metrics_pgpool},
prom::{
download_metadata_inserted_total_inc, program_transformer_task_status_inc,
Expand All @@ -16,10 +16,7 @@ use {
},
chrono::Utc,
crypto::{digest::Digest, sha2::Sha256},
das_core::{
DownloadMetadata, DownloadMetadataInfo,
DownloadMetadataNotifier,
},
das_core::{DownloadMetadata, DownloadMetadataInfo, DownloadMetadataNotifier},
digital_asset_types::dao::{sea_orm_active_enums::TaskStatus, tasks},
futures::{
future::{pending, BoxFuture, FusedFuture, FutureExt},
Expand Down Expand Up @@ -203,8 +200,6 @@ pub async fn run_v2(config: ConfigIngester) -> anyhow::Result<()> {
} else {
debug!("Message acknowledged successfully");
}


}
}
}
Expand Down
4 changes: 2 additions & 2 deletions metadata_json/src/cmds/backfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ pub struct BackfillArgs {
pub async fn run(args: BackfillArgs) -> Result<(), anyhow::Error> {
let batch_size = args.batch_size;

let pool = connect_db(args.database).await?;
let pool = connect_db(&args.database).await?;

setup_metrics(args.metrics)?;
setup_metrics(&args.metrics)?;

let client = ClientBuilder::new()
.timeout(Duration::from_millis(args.timeout))
Expand Down
4 changes: 2 additions & 2 deletions metadata_json/src/cmds/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ pub struct IngestArgs {
pub async fn run(args: IngestArgs) -> Result<(), anyhow::Error> {
let rx = Receiver::try_from_config(args.receiver.into()).await?;

let pool = connect_db(args.database).await?;
let pool = connect_db(&args.database).await?;

setup_metrics(args.metrics)?;
setup_metrics(&args.metrics)?;

let client = ClientBuilder::new()
.timeout(Duration::from_millis(args.timeout))
Expand Down
4 changes: 2 additions & 2 deletions metadata_json/src/cmds/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ pub struct ReportArgs {
}

pub async fn run(args: ReportArgs) -> Result<(), anyhow::Error> {
let pool = connect_db(args.database).await?;
let pool = connect_db(&args.database).await?;

setup_metrics(args.metrics)?;
setup_metrics(&args.metrics)?;

loop {
{
Expand Down
4 changes: 2 additions & 2 deletions metadata_json/src/cmds/single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ pub struct SingleArgs {
}

pub async fn run(args: SingleArgs) -> Result<(), anyhow::Error> {
let pool = connect_db(args.database).await?;
let pool = connect_db(&args.database).await?;

setup_metrics(args.metrics)?;
setup_metrics(&args.metrics)?;

let asset_data = bs58::decode(args.mint.as_str()).into_vec()?;

Expand Down
1 change: 1 addition & 0 deletions nft_ingester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ cadence-macros = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true, features = ["derive", "cargo"] }
das-core = { workspace = true }
das-metadata-json = { workspace = true }
digital_asset_types = { workspace = true, features = [
"json_types",
"sql_types",
Expand Down

0 comments on commit dd8103a

Please sign in to comment.