You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/11/03 12:21:25 UTC
[GitHub] [shardingsphere-elasticjob] wujiuye commented on issue #2005: The exception information of the previous slice execution is not cleared
wujiuye commented on issue #2005:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2005#issuecomment-958979376
This can be reproduced:
```
public class JavaSimpleJob implements SimpleJob {
private final FooRepository fooRepository = FooRepositoryFactory.getFooRepository();
@Override
public void execute(final ShardingContext shardingContext) {
if (shardingContext.getShardingItem() == System.currentTimeMillis()%shardingContext.getShardingTotalCount()) {
throw new NullPointerException("java simple job null " + System.currentTimeMillis());
}
System.out.printf("Item: %s | Time: %s | Thread: %s | %s%n",
shardingContext.getShardingItem(), new SimpleDateFormat("HH:mm:ss").format(new Date()), Thread.currentThread().getId(), "SIMPLE");
List<Foo> data = fooRepository.findTodoData(shardingContext.getShardingParameter(), 10);
for (Foo each : data) {
fooRepository.setCompleted(each.getId());
}
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org