Skip to content

Commit f642cd1

Browse files
committed
fdbPathLevels
1 parent a99715b commit f642cd1

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

AppInit.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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; // минут

Engine/FileDB/staticDB.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)