فهرست منبع

没有停顿的队列,加上停顿处理

lichunlei 2 سال پیش
والد
کامیت
b188083662
3فایلهای تغییر یافته به همراه10 افزوده شده و 2 حذف شده
  1. 4 0
      AppStart/Timer/AlipayPayBack2Timer.cs
  2. 4 0
      AppStart/Timer/StoreApplyHelper.cs
  3. 2 2
      AppStart/UserMonthFeeHelper.cs

+ 4 - 0
AppStart/Timer/AlipayPayBack2Timer.cs

@@ -31,5 +31,9 @@ public class AlipayPayBack2Timer : BackgroundService
             JobMqMsg job = Newtonsoft.Json.JsonConvert.DeserializeObject<JobMqMsg>(MsgContent);
             AlipayPayBack2Service.Instance.Start(job);
         }
+        else
+        {
+            Thread.Sleep(1000);
+        }
     }
 }

+ 4 - 0
AppStart/Timer/StoreApplyHelper.cs

@@ -73,6 +73,10 @@ public class StoreApplyHelper
                     int UserId = int.Parse(data);
                     if(UserId > 0) DoSomething(db, UserId);
                 }
+                else
+                {
+                    Thread.Sleep(10000);
+                }
             }
             catch(Exception ex)
             {

+ 2 - 2
AppStart/UserMonthFeeHelper.cs

@@ -95,9 +95,9 @@ public class UserMonthFeeHelper
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "创客每月月费扣款异常");
+                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "创客每月月费扣款异常");
             }
-            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "创客每月月费扣款日志");
+            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "创客每月月费扣款日志");
             Thread.Sleep(60000);
         }
     }