@@ -51,6 +51,9 @@ pub struct Cli {
51
51
/// Size for local cache
52
52
pub local_cache_size : u64 ,
53
53
54
+ /// Size for local cache
55
+ pub local_cache_time_range : i64 ,
56
+
54
57
/// Username for the basic authentication on the server
55
58
pub username : String ,
56
59
@@ -108,6 +111,7 @@ impl Cli {
108
111
pub const DOMAIN_URI : & ' static str = "origin" ;
109
112
pub const STAGING : & ' static str = "local-staging-path" ;
110
113
pub const CACHE : & ' static str = "cache-path" ;
114
+ pub const CACHE_TIME_RANGE : & ' static str = "cache-time-range" ;
111
115
pub const QUERY_CACHE : & ' static str = "query-cache-path" ;
112
116
pub const QUERY_CACHE_SIZE : & ' static str = "query-cache-size" ;
113
117
pub const CACHE_SIZE : & ' static str = "cache-size" ;
@@ -198,7 +202,16 @@ impl Cli {
198
202
. help ( "Maximum allowed cache size for all streams combined (In human readable format, e.g 1GiB, 2GiB)" )
199
203
. next_line_help ( true ) ,
200
204
)
201
-
205
+ . arg (
206
+ Arg :: new ( Self :: CACHE_TIME_RANGE )
207
+ . long ( Self :: CACHE_TIME_RANGE )
208
+ . env ( "P_CACHE_TIME_RANGE" )
209
+ . value_name ( "days" )
210
+ . default_value ( "10" )
211
+ . value_parser ( value_parser ! ( i64 ) )
212
+ . help ( "Maximum allowed time in days for all streams combined (In human readable format, e.g 1, 2)" )
213
+ . next_line_help ( true ) ,
214
+ )
202
215
. arg (
203
216
Arg :: new ( Self :: QUERY_CACHE )
204
217
. long ( Self :: QUERY_CACHE )
@@ -404,6 +417,11 @@ impl FromArgMatches for Cli {
404
417
self . tls_key_path = m. get_one :: < PathBuf > ( Self :: TLS_KEY ) . cloned ( ) ;
405
418
self . domain_address = m. get_one :: < Url > ( Self :: DOMAIN_URI ) . cloned ( ) ;
406
419
420
+ self . local_cache_time_range = m
421
+ . get_one :: < i64 > ( Self :: CACHE_TIME_RANGE )
422
+ . cloned ( )
423
+ . expect ( "default value for cache time range" ) ;
424
+
407
425
self . address = m
408
426
. get_one :: < String > ( Self :: ADDRESS )
409
427
. cloned ( )
0 commit comments