Browse Source

调整奖励队列

lcl 1 year ago
parent
commit
82096fdd12
1 changed files with 3 additions and 32 deletions
  1. 3 32
      AppStart/Service/PrizeSendService.cs

+ 3 - 32
AppStart/Service/PrizeSendService.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using Library;
+using LitJson;
 using System.Linq;
 using System.Threading;
 using System.Text;
@@ -29,7 +30,8 @@ namespace MySystem
                 {
                     try
                     {
-                        RabbitMQPrize.Instance.SendMsg(content, "PRIZE_SEND_QUEUE");
+                        JsonData jsonObj = JsonMapper.ToObject(content);
+                        RabbitMQPrize.Instance.SendMsg(jsonObj["content"].ToString(), "PRIZE_SEND_QUEUE" + jsonObj["prize_tag"].ToString());
                     }
                     catch (Exception ex)
                     {                        
@@ -42,36 +44,5 @@ namespace MySystem
                 }
             }
         }
-
-
-        public void StartMp()
-        {
-            Thread th = new Thread(dosomethingMp);
-            th.IsBackground = true;
-            th.Start();
-        }
-
-        public void dosomethingMp()
-        {
-            while (true)
-            {
-                string content = MpRedisDbconn.Instance.RPop<string>("KxsActQueue");
-                if (!string.IsNullOrEmpty(content))
-                {
-                    try
-                    {
-                        RabbitMQClient.Instance.SendMsg3(content, "QUEUE_KXS_ACT_DIVISION");
-                    }
-                    catch (Exception ex)
-                    {                        
-                        function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "推送客小爽码牌激活数据异常");
-                    }
-                }
-                else
-                {
-                    Thread.Sleep(500);
-                }
-            }
-        }
     }
 }