From 80b9a490a38d69e8f410da6612fd2e47cbc089b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 14 Jul 2019 14:42:21 +0300 Subject: [PATCH] Fix Fix configuration --- TestApp/MyService.cs | 4 ++-- TestApp/Program.cs | 3 ++- ZeroLevel/Services/Config/Configuration.cs | 4 ++-- ZeroLevel/ZeroLevel.csproj | 9 ++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/TestApp/MyService.cs b/TestApp/MyService.cs index 316b8af..b4cc0ee 100644 --- a/TestApp/MyService.cs +++ b/TestApp/MyService.cs @@ -19,7 +19,7 @@ namespace TestApp { Log.Info("Started"); ReadServiceInfo(); - var host = UseHost(); + var host = UseHost(8800); AutoregisterInboxes(host); host.OnConnect += Host_OnConnect; host.OnDisconnect += Host_OnDisconnect; @@ -31,7 +31,7 @@ namespace TestApp Interlocked.Exchange(ref counter, 0); }); - //Exchange.RoutesStorage.Set("test.app", new IPEndPoint(IPAddress.Loopback, 8800)); + Exchange.RoutesStorage.Set("test.app", new IPEndPoint(IPAddress.Loopback, 8800)); while (true) { diff --git a/TestApp/Program.cs b/TestApp/Program.cs index 589882e..168c4ce 100644 --- a/TestApp/Program.cs +++ b/TestApp/Program.cs @@ -6,10 +6,11 @@ namespace TestApp { private static void Main(string[] args) { + Configuration.Save(Configuration.ReadFromApplicationConfig()); Bootstrap.Startup(args, () => Configuration.ReadSetFromIniFile("config.ini")) .EnableConsoleLog(ZeroLevel.Services.Logging.LogLevel.System | ZeroLevel.Services.Logging.LogLevel.FullDebug) - .UseDiscovery() + //.UseDiscovery() .Run() .WaitWhileStatus(ZeroServiceStatus.Running) .Stop(); diff --git a/ZeroLevel/Services/Config/Configuration.cs b/ZeroLevel/Services/Config/Configuration.cs index 135eb5d..385b3b0 100644 --- a/ZeroLevel/Services/Config/Configuration.cs +++ b/ZeroLevel/Services/Config/Configuration.cs @@ -59,7 +59,7 @@ namespace ZeroLevel } else { - throw new Exception("Default configuration exists already"); + DefaultSet.Merge(Configuration.CreateSet(configuration)); } } @@ -76,7 +76,7 @@ namespace ZeroLevel } else { - throw new Exception("Default configurationset set already"); + DefaultSet.Merge(configuration); } } diff --git a/ZeroLevel/ZeroLevel.csproj b/ZeroLevel/ZeroLevel.csproj index a622675..255f578 100644 --- a/ZeroLevel/ZeroLevel.csproj +++ b/ZeroLevel/ZeroLevel.csproj @@ -5,17 +5,16 @@ Infrastructure layer library ogoun ogoun - 3.0.0.3 - Fix file transfer -Expand serialization types + 3.0.0.4 + Fix configuration https://github.com/ogoun/Zero/wiki Copyright Ogoun 2019 https://opensource.org/licenses/MIT https://raw.githubusercontent.com/ogoun/Zero/master/zero.png https://github.com/ogoun/Zero GitHub - 3.0.3 - 3.0.0.3 + 3.0.4 + 3.0.0.4