Example #1
0
 public static void Init()
 {
     try
     {
         DisconfMgr.Init();
     }
     catch (Exception ex)
     {
         Logger.Error("DisconfServiceCheckJob异常", ex);
     }
 }
Example #2
0
        static void Main(string[] args)
        {
Reload:

            try
            {
                DisconfMgr.Init();
                Console.WriteLine();
            }
            catch (Exception ex)
            {
                Logger.Error("Disconf.Net.Test", ex);
            }

            var keys = Console.ReadKey();

            if (keys.Key != ConsoleKey.Escape)
            {
                goto Reload;
            }
        }
Example #3
0
        protected override void OnStop()
        {
            var msg = new StringBuilder("");

            try
            {
                msg.AppendLine("定时任务停止");
                _sched.Shutdown(false);

                msg.AppendLine("释放Disconf资源");
                DisconfMgr.Stop();

                msg.AppendLine("服务停止");
                Logger.Info(msg.ToString());
            }
            catch (Exception ex)
            {
                msg.AppendLine($"【服务停止异常】{ex.ToString()}");
                Logger.Error(msg.ToString(), ex);
            }
        }