Commit f60d6fb2 by lizefeng

fix

parent 13b563a9
...@@ -12,6 +12,7 @@ using System.Text.RegularExpressions; ...@@ -12,6 +12,7 @@ using System.Text.RegularExpressions;
using AutoTurnOver.Models.Base; using AutoTurnOver.Models.Base;
using System.Threading.Tasks; using System.Threading.Tasks;
using AutoTurnOver.Models.ApiDto.Stock; using AutoTurnOver.Models.ApiDto.Stock;
using System.Threading;
namespace AutoTurnOver.Services namespace AutoTurnOver.Services
{ {
...@@ -262,7 +263,9 @@ namespace AutoTurnOver.Services ...@@ -262,7 +263,9 @@ namespace AutoTurnOver.Services
/// 获取亚马逊账号 /// 获取亚马逊账号
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static List<AmazonAccountDto> GetAmazonAccountList() public static List<AmazonAccountDto> GetAmazonAccountList(int count = 0)
{
try
{ {
string url = ConfigHelper.GetValue("Pams_GetAccountToken"); string url = ConfigHelper.GetValue("Pams_GetAccountToken");
string resultStr = HttpHelper.Request(url, RequestType.GET, "", timeout: 1000 * 60 * 60 * 24); string resultStr = HttpHelper.Request(url, RequestType.GET, "", timeout: 1000 * 60 * 60 * 24);
...@@ -277,6 +280,22 @@ namespace AutoTurnOver.Services ...@@ -277,6 +280,22 @@ namespace AutoTurnOver.Services
} }
return result.Data; return result.Data;
} }
catch (Exception ex)
{
if (count < 20)
{
Thread.Sleep(10 * 1000);
count++;
return GetAmazonAccountList(count);
}
else
{
throw;
}
}
}
public static List<AccountDto> AccountList(string name) public static List<AccountDto> AccountList(string name)
{ {
......
...@@ -57,7 +57,7 @@ namespace ResetOutofstock ...@@ -57,7 +57,7 @@ namespace ResetOutofstock
//new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2, 10); //new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2, 10);
//while (true) //while (true)
//{ //{
// new AmazonDataSynchroService().AnaReport(); // new AmazonDataSynchroService().AnaReport(-1);
//} //}
} }
catch (Exception ex) catch (Exception ex)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment