Use in-memory SQLite prefs DB when UserData is virtual.

This commit is contained in:
Pieter-Jan Briers
2020-08-20 18:46:46 +02:00
parent 3203fdfb7f
commit 496b456120
2 changed files with 23 additions and 8 deletions

View File

@@ -50,11 +50,11 @@ namespace Content.Server.Preferences
{
case "sqlite":
var configPreferencesDbPath = _configuration.GetCVar<string>("database.prefs_sqlite_dbpath");
var finalPreferencesDbPath =
var inMemory = _resourceManager.UserData.RootDir == null;
var finalPreferencesDbPath = inMemory ?
null :
Path.Combine(_resourceManager.UserData.RootDir, configPreferencesDbPath);
dbConfig = new SqliteConfiguration(
finalPreferencesDbPath
);
dbConfig = new SqliteConfiguration(finalPreferencesDbPath);
break;
case "postgres":
dbConfig = new PostgresConfiguration(