Esempio n. 1
0
 /// <summary>
 /// 标记执行返回结果
 /// </summary>
 /// <param name="id"> </param>
 /// <param name="result"></param>
 private static void ProcessSendResult(Guid id, object result)
 {
     if (result != null)
     {
         var exception = result as Exception;
         if (exception != null)
         {
             var    exp     = exception;
             string message = exp.Message;
             if (exp.InnerException != null)
             {
                 message += " => " + exp.InnerException.Message;
             }
             ExceptionDao.UpdateExceptionCount(id, message);
         }
         else
         {
             var returnInfo = result as WCFReturnInfo;
             if (returnInfo != null)
             {
                 var info = returnInfo;
                 if (!info.IsSuccess)
                 {
                     ExceptionDao.UpdateExceptionCount(id, info.ErrorMessage);
                 }
                 else
                 {
                     ExceptionDao.DeleteExceptionBySuccess(id);
                 }
             }
         }
     }
 }
Esempio n. 2
0
        public static void ProcessDeleteSuccess()
        {
            var threadStart = new ThreadStart(() => ExceptionDao.DeleteSuccessExceptionByBeforeDay(7));
            var thread      = new Thread(threadStart);

            thread.Start();
        }
Esempio n. 3
0
        static Process()
        {
            _fromSourceDict = new Dictionary <Guid, string>();
            var list = ExceptionDao.GetFromSources();

            foreach (var info in list)
            {
                if (!_fromSourceDict.ContainsKey(info.Id))
                {
                    _fromSourceDict.Add(info.Id, info.EndPointName);
                }
            }
        }
Esempio n. 4
0
        public static void ProcessFailure(int quantity, int failCount)
        {
            var items = ExceptionDao.GetFailureExceptionByFailCount(quantity, failCount);

            foreach (var commandInfo in items)
            {
                CommandInfo info = commandInfo;
#if debug
                Execute(info);
#else
                var threadStart = new ThreadStart(() => Execute(info));
                var thread      = new Thread(threadStart);
                thread.Start();
#endif
            }
        }
Esempio n. 5
0
        public static void ProcessNoSend(int quantity)
        {
            var items = ExceptionDao.GetNoSendCommand(quantity);

            foreach (var commandInfo in items)
            {
                CommandInfo info = commandInfo;
#if debug
                Execute(info);
#else
                var threadStart = new ThreadStart(() => Execute(info));
                var thread      = new Thread(threadStart);
                thread.Start();
#endif
            }
        }