feat(1.4.0-beta1): 1. 修复手动执行失败问题
This commit is contained in:
		
							parent
							
								
									31f0768cbd
								
							
						
					
					
						commit
						03597ea97c
					
				@ -9,6 +9,8 @@ import com.aizuda.snailjob.client.core.log.RetryLogMeta;
 | 
				
			|||||||
import com.aizuda.snailjob.client.core.retryer.RetryerInfo;
 | 
					import com.aizuda.snailjob.client.core.retryer.RetryerInfo;
 | 
				
			||||||
import com.aizuda.snailjob.common.core.context.SnailSpringContext;
 | 
					import com.aizuda.snailjob.common.core.context.SnailSpringContext;
 | 
				
			||||||
import com.aizuda.snailjob.common.core.enums.RetryStatusEnum;
 | 
					import com.aizuda.snailjob.common.core.enums.RetryStatusEnum;
 | 
				
			||||||
 | 
					import com.aizuda.snailjob.common.core.util.JsonUtil;
 | 
				
			||||||
 | 
					import com.aizuda.snailjob.common.log.SnailJobLog;
 | 
				
			||||||
import com.aizuda.snailjob.common.log.enums.LogTypeEnum;
 | 
					import com.aizuda.snailjob.common.log.enums.LogTypeEnum;
 | 
				
			||||||
import lombok.RequiredArgsConstructor;
 | 
					import lombok.RequiredArgsConstructor;
 | 
				
			||||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
 | 
					import org.springframework.beans.factory.NoSuchBeanDefinitionException;
 | 
				
			||||||
@ -47,6 +49,8 @@ public class RemoteCallbackExecutor {
 | 
				
			|||||||
            // 以Spring Bean模式回调
 | 
					            // 以Spring Bean模式回调
 | 
				
			||||||
            doCallbackForSpringBean(context);
 | 
					            doCallbackForSpringBean(context);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 上报执行成功
 | 
				
			||||||
 | 
					            SnailJobLog.REMOTE.info("任务执行成功 taskId:[{}]", context.getRetryTaskId());
 | 
				
			||||||
        } catch (NoSuchBeanDefinitionException e) {
 | 
					        } catch (NoSuchBeanDefinitionException e) {
 | 
				
			||||||
            // 若不是SpringBean 则直接反射以普通类调用
 | 
					            // 若不是SpringBean 则直接反射以普通类调用
 | 
				
			||||||
            doCallbackForOrdinaryClass(context);
 | 
					            doCallbackForOrdinaryClass(context);
 | 
				
			||||||
@ -120,7 +124,7 @@ public class RemoteCallbackExecutor {
 | 
				
			|||||||
        ReflectionUtils.invokeMethod(method, retryCompleteCallback, retryerInfo.getScene(),
 | 
					        ReflectionUtils.invokeMethod(method, retryCompleteCallback, retryerInfo.getScene(),
 | 
				
			||||||
                retryerInfo.getExecutorClassName(), deSerialize);
 | 
					                retryerInfo.getExecutorClassName(), deSerialize);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        SnailJobLog.REMOTE.info("任务执行成功 taskId:[{}] [{}]", context.getRetryTaskId());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -79,9 +79,9 @@ public class RetryExecutor extends AbstractActor {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private void doExecute(RetryTaskExecuteDTO execute) {
 | 
					    private void doExecute(RetryTaskExecuteDTO execute) {
 | 
				
			||||||
        LambdaQueryWrapper<Retry> wrapper = new LambdaQueryWrapper<>();
 | 
					        LambdaQueryWrapper<Retry> wrapper = new LambdaQueryWrapper<>();
 | 
				
			||||||
 | 
					        wrapper.eq(Retry::getId, execute.getRetryId());
 | 
				
			||||||
        if (RetryTaskExecutorSceneEnum.MANUAL_RETRY.getScene() != execute.getRetryTaskExecutorScene()) {
 | 
					        if (RetryTaskExecutorSceneEnum.MANUAL_RETRY.getScene() != execute.getRetryTaskExecutorScene()) {
 | 
				
			||||||
            wrapper.eq(Retry::getId, execute.getRetryId()).eq(Retry::getRetryStatus, RetryStatusEnum.RUNNING.getStatus());
 | 
					            wrapper.eq(Retry::getRetryStatus, RetryStatusEnum.RUNNING.getStatus());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Retry retry = retryMapper.selectOne(wrapper);
 | 
					        Retry retry = retryMapper.selectOne(wrapper);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user