File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,15 @@ pub struct Options {
225
225
) ]
226
226
pub hot_tier_storage_path : Option < PathBuf > ,
227
227
228
+ //TODO: remove this when smart cache is implemented
229
+ #[ arg(
230
+ long = "index-storage-path" ,
231
+ env = "P_INDEX_DIR" ,
232
+ value_parser = validation:: canonicalize_path,
233
+ help = "Local path on this indexer used for indexing"
234
+ ) ]
235
+ pub index_storage_path : Option < PathBuf > ,
236
+
228
237
#[ arg(
229
238
long,
230
239
env = "P_MAX_DISK_USAGE_PERCENT" ,
@@ -419,6 +428,17 @@ impl Options {
419
428
& self . local_staging_path
420
429
}
421
430
431
+ /// Path to index directory, ensures that it exists or returns the PathBuf
432
+ pub fn index_dir ( & self ) -> Option < & PathBuf > {
433
+ if let Some ( path) = & self . index_storage_path {
434
+ fs:: create_dir_all ( path)
435
+ . expect ( "Should be able to create index directory if it doesn't exist" ) ;
436
+ Some ( path)
437
+ } else {
438
+ None
439
+ }
440
+ }
441
+
422
442
/// TODO: refactor and document
423
443
pub fn get_url ( & self , mode : Mode ) -> Url {
424
444
let ( endpoint, env_var) = match mode {
You can’t perform that action at this time.
0 commit comments