Skip to content

Commit

Permalink
[indexer grpc] compression support. (aptos-labs#11470)
Browse files Browse the repository at this point in the history
* compression support.
  • Loading branch information
larry-aptos authored Jan 8, 2024
1 parent 3e5aa2e commit a808904
Show file tree
Hide file tree
Showing 23 changed files with 1,548 additions and 916 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

9 changes: 9 additions & 0 deletions ecosystem/indexer-grpc/indexer-grpc-cache-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,26 @@ pub struct IndexerGrpcCacheWorkerConfig {
pub fullnode_grpc_address: Url,
pub file_store_config: IndexerGrpcFileStoreConfig,
pub redis_main_instance_address: RedisUrl,
#[serde(default = "default_enable_cache_compression")]
pub enable_cache_compression: bool,
}

const fn default_enable_cache_compression() -> bool {
false
}

impl IndexerGrpcCacheWorkerConfig {
pub fn new(
fullnode_grpc_address: Url,
file_store_config: IndexerGrpcFileStoreConfig,
redis_main_instance_address: RedisUrl,
enable_cache_compression: bool,
) -> Self {
Self {
fullnode_grpc_address,
file_store_config,
redis_main_instance_address,
enable_cache_compression,
}
}
}
Expand All @@ -40,6 +48,7 @@ impl RunnableConfig for IndexerGrpcCacheWorkerConfig {
self.fullnode_grpc_address.clone(),
self.redis_main_instance_address.clone(),
self.file_store_config.clone(),
self.enable_cache_compression,
)
.await
.context("Failed to create cache worker")?;
Expand Down
Loading

0 comments on commit a808904

Please sign in to comment.