| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.Collections.Generic;
- using Library;
- using LitJson;
- using System.Linq;
- using System.Threading;
- using System.Text;
- namespace MySystem
- {
- public class SendPrizeDataService
- {
- public readonly static SendPrizeDataService Instance = new SendPrizeDataService();
- private SendPrizeDataService()
- { }
- public void Start()
- {
- Thread th = new Thread(dosomething);
- th.IsBackground = true;
- th.Start();
- }
- public void dosomething()
- {
- while (true)
- {
- string content = RedisDbconn.Instance.RPop<string>("HaoDaPrizeDataQueue");
- if (!string.IsNullOrEmpty(content))
- {
- try
- {
- RabbitMQClient.Instance.SendPrize(content, "QUEUE_KXS_HAODA_PRIZE_CONFIG_DIVISION");
- }
- catch (Exception ex)
- {
- Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "推送好哒奖励数据异常");
- }
- }
- else
- {
- Thread.Sleep(2000);
- }
- }
- }
- }
- }
|