Changed debug writepoints

This commit is contained in:
Rick Falkvinge
2013-06-08 15:52:38 +00:00
parent 36de19a445
commit bf4809fb58
2 changed files with 9 additions and 5 deletions
+7 -5
View File
@@ -103,20 +103,22 @@ namespace Swarmops.Database
public static string GetConfigurationFileName()
{
// If we're running in a HTTP context, use the Mono path mapper, as we're in an Apache process.
// If we're running in a HTTP context on Windows, use the path mapper, as we're in a web process.
// Otherwise, use a relative path from the binary.
if (HttpContext.Current != null)
if (HttpContext.Current != null && Path.DirectorySeparatorChar != '/')
{
// Apache process, so use MapPath
// Web process, so use MapPath
return HttpContext.Current.Server.MapPath("~/database.config");
}
else
{
// Backend process - just use the simple filename (and copy frontend's config to backend's on daemon start).
// Production process - just use the simple filename
return "database.config";
Console.WriteLine("Returning /etc/swarmops/database.config");
return "/etc/swarmops/database.config";
}
}
}
+2
View File
@@ -17,6 +17,8 @@ namespace Swarmops.Database
{
public static SwarmDb GetDatabaseForReading()
{
Console.WriteLine("In GetDatabaseForReading()");
return new SwarmDb(ConstructConnectString(new Configuration().Get().Read));
}