Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
目前设置了任务队列数量为3,提交第4个任务时候并不会提示开始排队,提交第5个任务时候会开始排队计数,且返回前面任务为1个。
应当在this.taskExecutor.submit执行之后再检查队列中的任务数量获取getQueue().size(),这样避免排队数量统计遗漏的错误。
修改后的结果为:设置了任务队列数量为3时,提交第4个任务时候提示还有1个任务等待,提交第5个任务时候提示前面任务为2个。