|
@@ -0,0 +1,55 @@
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.IO;
|
|
|
+using System.Threading;
|
|
|
+using Library;
|
|
|
+using LitJson;
|
|
|
+using MySystem;
|
|
|
+
|
|
|
+public class TestHelper
|
|
|
+{
|
|
|
+ public readonly static TestHelper Instance = new TestHelper();
|
|
|
+ private TestHelper()
|
|
|
+ { }
|
|
|
+
|
|
|
+ public void Start()
|
|
|
+ {
|
|
|
+ Thread th = new Thread(DoQueue);
|
|
|
+ th.IsBackground = true;
|
|
|
+ th.Start();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void DoWorks()
|
|
|
+ {
|
|
|
+ while (true)
|
|
|
+ {
|
|
|
+ string content = RedisDbconn.Instance.RPop<string>("LogQueue");
|
|
|
+ if (!string.IsNullOrEmpty(content))
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + content + "\n" + ex, "SLS日志异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Thread.Sleep(5000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void DoQueue()
|
|
|
+ {
|
|
|
+ string[] list = function.ReadInstance("9.txt").Split('\n');
|
|
|
+ string result = ",";
|
|
|
+ foreach(string sub in list)
|
|
|
+ {
|
|
|
+ function.WriteLog(sub);
|
|
|
+ string[] data = sub.Split('|');
|
|
|
+ result += function.GetWebRequest("https://logic-executor-api.kexiaoshuang.com/noauth/prize/pushbyone?n=" + data[1] + "&m=" + data[0] + "&ids=" + data[2]) + ",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|