diff --git a/Mime/HttpMimeServier.cs b/Mime/HttpMimeServier.cs index 790d9bd..dd1fcb9 100644 --- a/Mime/HttpMimeServier.cs +++ b/Mime/HttpMimeServier.cs @@ -40,7 +40,7 @@ namespace UMC.Host var l = hostName.IndexOf('.'); if (l > 0) { - if (UMC.Net.Certificater.Certificates.TryGetValue("*" + hostName.Substring(l), out var x509)) + if (UMC.Net.Certificater.Certificates.TryGetValue("*" + hostName.Substring(l), out var x509) || UMC.Net.Certificater.Certificates.TryGetValue("*." + hostName, out x509)) { return x509.Certificate ?? certificate; @@ -565,7 +565,7 @@ namespace UMC.Host UMC.Net.Certificater.Certificates[_v.Name] = _v; } _v.Status = -1; - pipeServer.Write(System.Text.Encoding.UTF8.GetBytes("\t\b正在签发证书,大约一分钟签发完成\r\n")); + pipeServer.Write(System.Text.Encoding.UTF8.GetBytes(hs["msg"] ?? "\t\b正在签发证书,大约一分钟签发完成\r\n")); new System.Threading.Tasks.Task(async () => { await Task.Delay(30000); diff --git a/Program.cs b/Program.cs index ca9fc65..cfa03e8 100644 --- a/Program.cs +++ b/Program.cs @@ -34,6 +34,13 @@ namespace UMC.Host { switch (variable) { + case "restart": + System.Threading.Thread.Sleep(1000); + if (IsRun() == false) + { + StartUp(args.Length == 2 ? args[1] : String.Empty); + } + return; case "start": if (IsRun() == false) { @@ -42,7 +49,7 @@ namespace UMC.Host return; } } - + Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Magenta; @@ -83,7 +90,7 @@ namespace UMC.Host } public static bool IsRun() - { + { var ls = Utility.Reader(UMC.Data.Utility.MapPath(".lock")); if (String.IsNullOrEmpty(ls) == false) { @@ -293,8 +300,12 @@ namespace UMC.Host private static void UnhandledException(object sender, UnhandledExceptionEventArgs e) { UMC.Data.Utility.Error("Unhandled", DateTime.Now, $"{e.ExceptionObject}"); - + if (IsRestart) + { + Excel("restart"); + } } + static bool IsRestart; static void ConfigDbProvider() { var urlKey = RuntimeInformation.RuntimeIdentifier; @@ -441,6 +452,7 @@ namespace UMC.Host } static void StartUp(string path) { + IsRestart = true; Register(); if (String.IsNullOrEmpty(path) == false) { @@ -449,7 +461,6 @@ namespace UMC.Host File.WriteAllText(UMC.Data.Utility.MapPath($".lock"), $"{{\"Id\":\"{System.Diagnostics.Process.GetCurrentProcess().Id}\"}}"); - // HotCache.Namespace("UMC.Proxy.Entities"); UMC.Activities.DataFactory.Instance(); UMC.Proxy.DataFactory.Instance(); UMC.Data.DataFactory.Instance();