File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,13 @@ use std::net::SocketAddr;
1818use anyhow:: bail;
1919use log:: info;
2020use metrics:: get_global_metrics;
21+ pub use oak_private_memory_database:: database_with_cache:: MAX_DECODE_SIZE ;
2122use sealed_memory_grpc_proto:: oak:: private_memory:: sealed_memory_database_service_client:: SealedMemoryDatabaseServiceClient ;
2223use tokio:: sync:: RwLock ;
2324use tonic:: transport:: { Channel , Endpoint } ;
25+
2426const MAX_CONNECT_RETRIES : usize = 5 ;
2527const INITIAL_BACKOFF_MS : u64 = 100 ;
26- pub const MAX_DECODE_SIZE : usize = 100 * 1024 * 1024 ; // 100 MB
2728
2829pub struct SharedDbClient {
2930 database_service_host : SocketAddr ,
Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ use crate::{
2626 memory_cache:: MemoryCache ,
2727} ;
2828
29- const DATABASE_MAX_SIZE : usize = 1024 * 1024 * 1024 ; // 1 GB
30-
29+ // We limit the decode size to 100 MB and use this limit as the max size of the
30+ // database.
31+ pub const MAX_DECODE_SIZE : usize = 100 * 1024 * 1024 ; // 100 MB
3132/// A database with cache. It loads the meta database of the user at start,
3233/// then loads documents at request. The loaded documents will be then cached
3334/// in memory.
@@ -52,7 +53,7 @@ impl DatabaseWithCache {
5253 cache : MemoryCache :: new ( db_client, dek) ,
5354 key_derivation_info,
5455 current_size : initial_size,
55- max_size : DATABASE_MAX_SIZE ,
56+ max_size : MAX_DECODE_SIZE ,
5657 }
5758 }
5859
You can’t perform that action at this time.
0 commit comments