From bf4809fb58bd849a67c2bb0b8abc0cbb07b0ed23 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 8 Jun 2013 15:52:38 +0000 Subject: [PATCH] Changed debug writepoints --- Database/Configuration.cs | 12 +++++++----- Database/Database-Constructors.cs | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Database/Configuration.cs b/Database/Configuration.cs index 23836400..da96c159 100644 --- a/Database/Configuration.cs +++ b/Database/Configuration.cs @@ -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"; } } } diff --git a/Database/Database-Constructors.cs b/Database/Database-Constructors.cs index bd41e4d0..f68fa7ef 100644 --- a/Database/Database-Constructors.cs +++ b/Database/Database-Constructors.cs @@ -17,6 +17,8 @@ namespace Swarmops.Database { public static SwarmDb GetDatabaseForReading() { + Console.WriteLine("In GetDatabaseForReading()"); + return new SwarmDb(ConstructConnectString(new Configuration().Get().Read)); }