Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static async Task<EmbeddedDatabase> GetInstance(CancellationToken cancell
};

// TODO: See if more refactoring can be done between this and the RavenPersisterSettings above
var embeddedConfig = new EmbeddedDatabaseConfiguration(settings.ServerUrl, RavenPersisterSettings.DatabaseNameDefault, dbPath, logPath, logsMode);
var embeddedConfig = new EmbeddedDatabaseConfiguration(settings.ServerUrl, RavenPersisterSettings.DatabaseNameDefault, dbPath, logPath, logsMode) { RunInMemory = true };

embeddedDatabase = EmbeddedDatabase.Start(embeddedConfig, new ApplicationLifetime(new NullLogger<ApplicationLifetime>()));

Expand Down
10 changes: 9 additions & 1 deletion src/ServiceControl.RavenDB/EmbeddedDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,22 @@ public static EmbeddedDatabase Start(EmbeddedDatabaseConfiguration databaseConfi
}

logger.LogInformation("Loading RavenDB license from {LicenseFileName}", licenseFileNameAndServerDirectory.LicenseFileName);

List<string> optionalArgs = [];
if (databaseConfiguration.RunInMemory)
{
optionalArgs.Add("--RunInMemory=true");
}

var serverOptions = new ServerOptions
{
CommandLineArgs =
[
$"--Logs.Mode={databaseConfiguration.LogsMode}",
// HINT: If this is not set, then Raven will pick a default location relative to the server binaries
// See https://github.com/ravendb/ravendb/issues/15694
$"--Indexing.NuGetPackagesPath=\"{nugetPackagesPath}\""
$"--Indexing.NuGetPackagesPath=\"{nugetPackagesPath}\"",
..optionalArgs
],
DataDirectory = databaseConfiguration.DbPath,
ServerUrl = databaseConfiguration.ServerUrl,
Expand Down
2 changes: 2 additions & 0 deletions src/ServiceControl.RavenDB/EmbeddedDatabaseConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class EmbeddedDatabaseConfiguration(string serverUrl, string dbName, stri
public string LogPath { get; } = logPath;
public string LogsMode { get; } = logsMode;

public bool RunInMemory { get; set; }

public Func<string, BlittableJsonReaderObject, string> FindClrType { get; init; }
}
}
Loading