Skip to content

Commit

Permalink
yop
Browse files Browse the repository at this point in the history
  • Loading branch information
just-in-chang committed Oct 2, 2024
1 parent 46f6a98 commit 25aa6b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions ecosystem/nft-metadata-crawler/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

use crate::{
asset_uploader::worker::{config::AssetUploaderWorkerConfig, AssetUploaderWorkerContext},
asset_uploader::{
api::AssetUploaderApiContext,
worker::{config::AssetUploaderWorkerConfig, AssetUploaderWorkerContext},
},
parser::{config::ParserConfig, ParserContext},
utils::database::{establish_connection_pool, run_migrations},
};
Expand All @@ -28,7 +31,7 @@ pub trait Server: Send + Sync {
pub enum ServerConfig {
Parser(ParserConfig),
AssetUploaderWorker(AssetUploaderWorkerConfig),
AssetUploaderAPI,
AssetUploaderApi,
}

/// Structs to hold config from YAML
Expand All @@ -45,6 +48,7 @@ pub struct NFTMetadataCrawlerConfig {
pub enum ServerContext {
Parser(ParserContext),
AssetUploaderWorker(AssetUploaderWorkerContext),
AssetUploaderApi(AssetUploaderApiContext),
}

impl ServerConfig {
Expand All @@ -61,8 +65,8 @@ impl ServerConfig {
asset_uploader_config.clone(),
))
},
ServerConfig::AssetUploaderAPI => {
unimplemented!()
ServerConfig::AssetUploaderApi => {
ServerContext::AssetUploaderApi(AssetUploaderApiContext::new(pool))
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};
use std::time::Duration;
use tracing::error;

#[derive(Debug, Deserialize, PartialEq, Eq, Hash, Identifiable, Queryable, Serialize)]
#[derive(Debug, Deserialize, Identifiable, Queryable, Serialize)]
#[diesel(primary_key(asset_uri))]
#[diesel(table_name = parsed_asset_uris)]
pub struct NFTMetadataCrawlerURIsQuery {
Expand Down

0 comments on commit 25aa6b6

Please sign in to comment.