private async Task DoCallBack() { List <HandleCallbackParam> list = new List <HandleCallbackParam>(); if (!taskQueue.TryDequeue(out var item)) { return; } list.Add(item); ReturnT result; try { result = await _adminClient.Callback(list).ConfigureAwait(false); } catch (Exception ex) { _logger.LogError(ex, "trigger callback error:{error}", ex.Message); result = ReturnT.Failed(ex.Message); _retryQueue.Push(list); } LogCallBackResult(result, list); }
private void DoCallback(IEnumerable <HandleCallbackParam> callbackParamList) { try { var callbackResult = _adminClient.Callback(callbackParamList); if (ReturnT.SUCCESS_CODE == callbackResult.code) { LogCallbackResult(callbackParamList, "<br>----------- xxl-job job callback finish."); return; } else { LogCallbackResult(callbackParamList, "<br>----------- xxl-job job callback fail, callbackResult:" + callbackResult); } } catch (Exception ex) { _logger.LogError(ex, "xxl-job, callback admin error."); LogCallbackResult(callbackParamList, "<br>----------- xxl-job job callback error, errorMsg:" + ex.Message); } _paramRepository.SaveCallbackParams(callbackParamList); }