Example #1
0
        /// <summary>
        /// 功能:停止服务
        /// </summary>
        public void Stop()
        {
            try
            {
                //关闭服务
                LogMQConsumerHelper.Release();

                //调用垃圾回收
                GC.Collect();
                GC.WaitForPendingFinalizers();
            }
            catch (Exception ex)
            {
                string strMessage = $"服务停止失败,原因:{SysLogHelper.GetErrorLogInfo(ex, true)}";
                SysLogHelper.LogMessage("LogHost.Start", strMessage);
            }
        }