Ejemplo n.º 1
0
        private async Task <(bool, bool)> CallBackWithoutRetryAsync(CallBackResult callBackResult, List <JobMessage> jobs)
        {
            var result = await _adminExecutor.CallBackExecutor(jobs.Select(x => new CallBackInfo()
            {
                Code = x.CallBackCode,
                LogId = x.LogId,
                Message = x.Reason
            }).ToList());

            var needRetry = false;

            if (!result)
            {
                var retries    = ++callBackResult.Retries;
                var retryCount = Math.Min(_options.CallBackRetryCount, 3);
                if (retries >= retryCount)
                {
                    needRetry = false;
                    _logger.LogError($"xxljob任务结果回调失败,已超过重试次数");
                }

                needRetry = true;
                _logger.LogError($"xxljob任务结果回调失败,logIds:{string.Join(",", jobs.Select(x => x.Id))},retries:{retries}");
            }

            return(result, needRetry);
        }
Ejemplo n.º 2
0
 public Finder(DirElement Root, CallBackResult Result) : this(Root)
 {
     image.Source = null;
     _bitmap?.Dispose();
     resultCallback = Result;
     textBox.Focus();
 }
Ejemplo n.º 3
0
        private void RostelecomCallBack(CallBackResult result)
        {
            MessageBox.Show(Convert.ToString(startDate - DateTime.Now));
            MessageBox.Show(Convert.ToString(result.StartPeriodDate));
            MessageBox.Show(lbase.SubscriberList.Count.ToString());

            excel.Dispose();
            excel = null;
        }
Ejemplo n.º 4
0
        public async Task <ActionResult> ProcessCallBack(string code, string scope)
        {
            try
            {
                var r = new CallBackResult(code, scope.Split(' '));
                var t = await trueLayerAuthApi.GetAuthToken(new TokenRequest(settings.ClientId, settings.ClientSecret, r.Code, GetRedirectUrl()));

                await loginsRepository.Add(new Login(Guid.NewGuid(), t.access_token, t.refresh_token, DateTime.UtcNow), CancellationToken.None);
            }
            catch (Exception e)
            {
                logger.LogError("Callback call failed", e);
            }

            return(Redirect(Url.Content("~/")));
        }
Ejemplo n.º 5
0
        public async Task CallBack(List <JobMessage> jobs)
        {
            if (jobs == null || jobs.Count <= 0)
            {
                return;
            }

            bool retry;
            var  callBackResult = new CallBackResult();

            do
            {
                var executedResult = await CallBackWithoutRetryAsync(callBackResult, jobs);

                var result = executedResult.Item1;
                if (result)
                {
                    return;
                }
                retry = executedResult.Item2;
            } while (retry);
        }
Ejemplo n.º 6
0
 public Finder(DirElement Root, Bitmap thumbnail, CallBackResult Result) : this(Root)
 {
     resultCallback = Result;
     SetThumbnail(thumbnail);
 }