Skip to content

Commit

Permalink
Merge branch 'main' into danenbm/update-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
danenbm committed Oct 13, 2023
2 parents e8ff92d + bd81f66 commit e2258f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions nft_ingester/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ pub struct IngesterConfig {
pub role: Option<IngesterRole>,
pub max_postgres_connections: Option<u32>,
pub account_stream_worker_count: Option<u32>,
pub account_backfill_stream_worker_count: Option<u32>,
pub transaction_stream_worker_count: Option<u32>,
pub transaction_backfill_stream_worker_count: Option<u32>,
pub code_version: Option<&'static str>,
pub background_task_runner_config: Option<BackgroundTaskRunnerConfig>,
pub cl_audits: Option<bool>, // save transaction logs for compressed nfts
Expand Down Expand Up @@ -68,9 +70,19 @@ impl IngesterConfig {
self.account_stream_worker_count.unwrap_or(2)
}

pub fn get_account_backfill_stream_worker_count(&self) -> u32 {
self.account_backfill_stream_worker_count
.unwrap_or_else(|| self.get_account_stream_worker_count())
}

pub fn get_transaction_stream_worker_count(&self) -> u32 {
self.transaction_stream_worker_count.unwrap_or(2)
}

pub fn get_transaction_backfill_stream_worker_count(&self) -> u32 {
self.transaction_backfill_stream_worker_count
.unwrap_or_else(|| self.get_transaction_stream_worker_count())
}
}

// Types and constants used for Figment configuration items.
Expand Down
6 changes: 4 additions & 2 deletions nft_ingester/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ pub async fn main() -> Result<(), IngesterError> {
},
ACCOUNT_STREAM,
);

}
for i in 0..config.get_account_backfill_stream_worker_count() {
let _account_backfill = account_worker::<RedisMessenger>(
database_pool.clone(),
config.get_messneger_client_config(),
Expand Down Expand Up @@ -177,7 +178,8 @@ pub async fn main() -> Result<(), IngesterError> {
config.cl_audits.unwrap_or(false),
TRANSACTION_STREAM,
);

}
for i in 0..config.get_transaction_backfill_stream_worker_count() {
let _txn_backfill = transaction_worker::<RedisMessenger>(
database_pool.clone(),
config.get_messneger_client_config(),
Expand Down

0 comments on commit e2258f5

Please sign in to comment.