mirror of
https://github.com/huiyadanli/RevokeMsgPatcher.git
synced 2025-07-08 00:07:13 +08:00
[+] 添加对最新补丁获取异常的跟踪
This commit is contained in:
parent
06c4ec8c0e
commit
53fbda1f53
|
@ -26,7 +26,7 @@ namespace RevokeMsgPatcher
|
||||||
private bool needUpdate = false;
|
private bool needUpdate = false;
|
||||||
private string getPatchJsonStatus = "GETTING"; // GETTING FAIL SUCCESS
|
private string getPatchJsonStatus = "GETTING"; // GETTING FAIL SUCCESS
|
||||||
|
|
||||||
private GAHelper ga = new GAHelper(); // Google Analytics 记录
|
private readonly GAHelper ga = GAHelper.Instance; // Google Analytics 记录
|
||||||
|
|
||||||
public void InitModifier()
|
public void InitModifier()
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,6 +17,24 @@ namespace RevokeMsgPatcher.Utils
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GAHelper
|
public class GAHelper
|
||||||
{
|
{
|
||||||
|
private static GAHelper instance = null;
|
||||||
|
private static readonly object obj = new object();
|
||||||
|
|
||||||
|
public static GAHelper Instance
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
lock (obj)
|
||||||
|
{
|
||||||
|
if (instance == null)
|
||||||
|
{
|
||||||
|
instance = new GAHelper();
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 根据实际情况修改
|
// 根据实际情况修改
|
||||||
private static readonly HttpClient client = HttpUtil.Client;
|
private static readonly HttpClient client = HttpUtil.Client;
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ namespace RevokeMsgPatcher.Utils
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine("第" + (i + 1) + "次请求异常:[" + ex.Message + "]\nURL:" + urls[i]);
|
Console.WriteLine("第" + (i + 1) + "次请求异常:[" + ex.Message + "]\nURL:" + urls[i]);
|
||||||
|
GAHelper.Instance.RequestPageView($"/main/json/request_ex/{i + 1}/{ex.Message}", "第" + (i + 1) + "次请求异常:[" + ex.Message + "]");
|
||||||
i++;
|
i++;
|
||||||
if (i >= urls.Length)
|
if (i >= urls.Length)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user