Skip to content

Commit

Permalink
Add snapshot config in ingester
Browse files Browse the repository at this point in the history
  • Loading branch information
kespinola committed Oct 7, 2024
1 parent a5f5c58 commit 637d7ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions grpc-ingest/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use {
},
};

pub const REDIS_STREAM_ACCOUNTS: &str = "ACCOUNTS";
pub const REDIS_STREAM_DATA_KEY: &str = "data";

pub async fn load<T>(path: impl AsRef<Path> + Copy) -> anyhow::Result<T>
Expand Down Expand Up @@ -139,7 +138,6 @@ impl ConfigGrpc {

#[derive(Debug, Clone, Deserialize)]
pub struct ConfigGrpcAccounts {
#[serde(default = "ConfigGrpcAccounts::default_stream")]
pub stream: String,
#[serde(
default = "ConfigGrpcAccounts::default_stream_maxlen",
Expand All @@ -153,10 +151,6 @@ pub struct ConfigGrpcAccounts {
}

impl ConfigGrpcAccounts {
pub fn default_stream() -> String {
REDIS_STREAM_ACCOUNTS.to_owned()
}

pub const fn default_stream_maxlen() -> usize {
100_000_000
}
Expand Down Expand Up @@ -232,6 +226,7 @@ pub struct ConfigIngester {
pub redis: String,
pub postgres: ConfigIngesterPostgres,
pub download_metadata: ConfigIngesterDownloadMetadata,
pub snapshots: ConfigIngestStream,
pub accounts: ConfigIngestStream,
pub transactions: ConfigIngestStream,
}
Expand Down Expand Up @@ -320,10 +315,6 @@ impl ConfigIngesterDownloadMetadata {
10
}

pub fn default_stream() -> String {
REDIS_STREAM_METADATA_JSON.to_owned()
}

pub const fn default_stream_maxlen() -> usize {
10_000_000
}
Expand Down
2 changes: 1 addition & 1 deletion grpc-ingest/src/ingester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub async fn run(config: ConfigIngester) -> anyhow::Result<()> {
})
.start()?;
let snapshot_stream = IngestStream::build()
.config(config.accounts.clone())
.config(config.snapshots.clone())
.connection(connection.clone())
.handler(move |info| {
let pt_snapshots = Arc::clone(&pt_snapshots);
Expand Down

0 comments on commit 637d7ab

Please sign in to comment.