Skip to content

Commit 482a5ca

Browse files
committed
fix #428 Customize delay in ReportsService.CreateReportAndDownloadFileAsync
1 parent 650280a commit 482a5ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Source/FikaAmazonAPI/Services/ReportService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ public async Task<bool> CancelReportScheduleAsync(string reportScheduleId)
246246
#endregion
247247

248248

249-
public string CreateReportAndDownloadFile(ReportTypes reportType, DateTime? dataStartTime = null, DateTime? dataEndTime = null, ReportOptions reportOptions = null, bool isRestrictedReport = false) =>
250-
Task.Run(() => CreateReportAndDownloadFileAsync(reportType, dataStartTime, dataEndTime, reportOptions, isRestrictedReport)).ConfigureAwait(false).GetAwaiter().GetResult();
251-
public async Task<string> CreateReportAndDownloadFileAsync(ReportTypes reportType, DateTime? dataStartTime = null, DateTime? dataEndTime = null, ReportOptions reportOptions = null, bool isRestrictedReport = false, List<MarketPlace> marketplaces = null)
249+
public string CreateReportAndDownloadFile(ReportTypes reportType, DateTime? dataStartTime = null, DateTime? dataEndTime = null, ReportOptions reportOptions = null, bool isRestrictedReport = false, List<MarketPlace> marketplaces = null, int millisecondsDelay = 500) =>
250+
Task.Run(() => CreateReportAndDownloadFileAsync(reportType, dataStartTime, dataEndTime, reportOptions, isRestrictedReport, marketplaces, millisecondsDelay)).ConfigureAwait(false).GetAwaiter().GetResult();
251+
public async Task<string> CreateReportAndDownloadFileAsync(ReportTypes reportType, DateTime? dataStartTime = null, DateTime? dataEndTime = null, ReportOptions reportOptions = null, bool isRestrictedReport = false, List<MarketPlace> marketplaces = null,int millisecondsDelay=500)
252252
{
253253
if (!isRestrictedReport && Enum.TryParse<RestrictedReportTypes>(reportType.ToString(), out _))
254254
{
@@ -297,7 +297,7 @@ public async Task<string> CreateReportAndDownloadFileAsync(ReportTypes reportTyp
297297
{
298298
return null;
299299
}
300-
else Task.Delay(500).Wait();
300+
else Task.Delay(millisecondsDelay).Wait();
301301
}
302302
return filePath;
303303
}

0 commit comments

Comments
 (0)