减少回调

This commit is contained in:
huangsimin 2022-07-26 17:52:58 +08:00
parent 159e25ddc6
commit eea062ce8e

View File

@ -67,17 +67,16 @@ public class PacketsProcessor implements RpcProcessor<PacketsProcessor.PacketsRe
work.setTaskQueueSize( work.getTaskQueueSize() - request.packets.size());
work.setUpdateAt(Instant.now());
log.debug("workerState taskQueueSize: {} psize: {}", work.getTaskQueueSize(), request.packets.size());
log.debug("workerState taskQueueSize: {} psize: {} state {}", work.getTaskQueueSize(), request.packets.size(), state.getWorkers().size());
var op = new Operate(OperateType.PUT);
op.setValue(work);
Operate.CallOperate(op, new OperateClosure() {
@Override
public void run(Status status) {
log.info("{}", this.getResponse());
var resp = new RaftResponse();
resp.setRedirect(StateServerFactory.getStateServer().getNode().getLeaderId());
resp.setSuccess(true);
// resp.setRedirect(StateServerFactory.getStateServer().getNode().getLeaderId());
rpcCtx.sendResponse(resp);
}