File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ public static AppInit conf
5353
5454 public bool evercache = false ;
5555
56+ public int fdbPathLevels = 2 ;
57+
5658 public int timeStatsUpdate = 20 ; // минут
5759
5860 public int timeSync = 10 ; // минут
Original file line number Diff line number Diff line change @@ -31,8 +31,17 @@ static FileDB()
3131 static string pathDb ( string key )
3232 {
3333 string md5key = HashTo . md5 ( key ) ;
34- Directory . CreateDirectory ( $ "Data/fdb/{ md5key [ 0 ] } ") ;
35- return $ "Data/fdb/{ md5key [ 0 ] } /{ md5key } ";
34+
35+ if ( AppInit . conf . fdbPathLevels == 2 )
36+ {
37+ Directory . CreateDirectory ( $ "Data/fdb/{ md5key . Substring ( 0 , 2 ) } ") ;
38+ return $ "Data/fdb/{ md5key . Substring ( 0 , 2 ) } /{ md5key . Substring ( 2 ) } ";
39+ }
40+ else
41+ {
42+ Directory . CreateDirectory ( $ "Data/fdb/{ md5key [ 0 ] } ") ;
43+ return $ "Data/fdb/{ md5key [ 0 ] } /{ md5key } ";
44+ }
3645 }
3746
3847 static string keyDb ( string name , string originalname )
You can’t perform that action at this time.
0 commit comments