You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

60 lines
1.6 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Sog.Properties;
namespace Sog
{
public class Program
{
public static void Main(string[] args)
{
//long iNow = DateTimeOffset.Now.ToUnixTimeSeconds();
bool bServerRunMode = false;
ServerEntry entry = null;
try
{
// var rm = new global::System.Resources.ResourceManager("MySql.Data.Resources", typeof(Program).Assembly);
string err = Resources.ReadFromStreamFailed;
AppParam appParam = new AppParam(args);
if(appParam.RunMode == AppRunMode.Run)
{
bServerRunMode = true;
}
//Console.ReadLine();
entry = new ServerEntry(appParam);
entry.Start();
}
catch (Exception ex)
{
if(bServerRunMode)
{
TraceLog.Exception(ex, true);
if (ex.InnerException != null)
{
TraceLog.Exception(ex.InnerException, true);
}
//告警
entry.GetApp().Alerter.AlertException(ex);
}
else
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
System.Threading.Thread.Sleep(500);
}
}
}
}