async Task <IHttpTransferResult> _retryDownload(DownloadQueueObject obj, IHttpTransferConfig downloadConfig) { var succeed = false; IHttpTransferResult result = null; var retryCount = 0; do { result = await _doDownload(obj, downloadConfig); if (retryCount < downloadConfig.Retries && (result == null || result.DownloadException != null || (!result.IsSuccessCode && downloadConfig.RetryOnNonSuccessCode))) { succeed = false; } else { succeed = true; } retryCount++; } while (succeed == false); return(result); }
public override bool OnResultRetrieved(IHttpTransferResult result) { var resultDic = new Dictionary <string, string> { { "Url", Service } }; if (result == null) { _logService.TrackEvent("ArloResultNull", resultDic, null); } else { if (!result.IsSuccessCode) { resultDic.Add("StatusCode", result.HttpStatusCode.ToString()); resultDic.Add("ResultText", result.Result); _logService.TrackEvent("ArloResultFailed", resultDic, null); } } return(base.OnResultRetrieved(result)); }
public virtual bool OnResultRetrieved(IHttpTransferResult result) { return(true); }