Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make rollup processing feature optional
Browse files Browse the repository at this point in the history
n00m4d committed Jul 10, 2024
1 parent 63105b8 commit 6bbcba6
Showing 2 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions nft_ingester/src/config.rs
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ pub struct IngesterConfig {
pub code_version: Option<&'static str>,
pub background_task_runner_config: Option<BackgroundTaskRunnerConfig>,
pub cl_audits: Option<bool>, // save transaction logs for compressed nfts
pub process_rollups: Option<bool>,
}

#[derive(Deserialize, PartialEq, Debug, Clone)]
24 changes: 13 additions & 11 deletions nft_ingester/src/main.rs
Original file line number Diff line number Diff line change
@@ -154,17 +154,19 @@ pub async fn main() -> Result<(), IngesterError> {
}
}

let rollup_persister = RollupPersister::new(
Arc::new(SqlxPostgresConnector::from_sqlx_postgres_pool(
database_pool.clone(),
)),
config.get_database_url(),
RollupDownloaderForPersister {},
);
tasks.spawn(async move {
rollup_persister.persist_rollups().await;
Ok(())
});
if config.process_rollups.unwrap_or_default() {
let rollup_persister = RollupPersister::new(
Arc::new(SqlxPostgresConnector::from_sqlx_postgres_pool(
database_pool.clone(),
)),
config.get_database_url(),
RollupDownloaderForPersister {},
);
tasks.spawn(async move {
rollup_persister.persist_rollups().await;
Ok(())
});
}
}
// Stream Size Timers ----------------------------------------
// Setup Stream Size Timers, these are small processes that run every 60 seconds and farm metrics for the size of the streams.

0 comments on commit 6bbcba6

Please sign in to comment.