You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
3 years ago
|
using Jd.ACES.Common.Exceptions;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Timers;
|
||
|
|
||
|
|
||
|
namespace Jd.ACES.Task
|
||
|
{
|
||
|
public class SendReportCacheTask
|
||
|
{
|
||
|
//private static ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||
|
|
||
|
public static void Task(Object obj, ElapsedEventArgs e)
|
||
|
{
|
||
|
//LOGGER.Info("send reports...");
|
||
|
// catch all exceptions
|
||
|
try
|
||
|
{
|
||
|
Dictionary<string, TDEClient> clientPool = TDEClient.clientPool;
|
||
|
foreach (KeyValuePair<string, TDEClient> kvp in clientPool)
|
||
|
{
|
||
|
TDEClient tdeClient = kvp.Value;
|
||
|
tdeClient.GetMonitorClient().Task();
|
||
|
Console.WriteLine("accesstoken:{0}, send report:", kvp.Key);
|
||
|
}
|
||
|
}
|
||
|
catch (MalformedException ex)
|
||
|
{
|
||
|
//LOGGER.Fatal(ex.Message);
|
||
|
}
|
||
|
catch (NoValidKeyException ex)
|
||
|
{
|
||
|
//LOGGER.Fatal(ex.Message);
|
||
|
}
|
||
|
catch (InvalidTokenException ex)
|
||
|
{
|
||
|
//LOGGER.Fatal(ex.Message);
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
//LOGGER.Fatal(ex.Message);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|