Commit 3a26f159 authored by yanzg's avatar yanzg

修改公式和计算帮助类

parent 1bfd8439
......@@ -83,9 +83,13 @@ public class YzgMqProcedure implements InitializingBean {
* @return
*/
private TimeUnit getTimeUnit(long waitTime) {
TimeUnit prevUnit = YZG_MQ_SYSTEM_QUEUE_PLAN_TIME[0];
for (TimeUnit timeUnit : YZG_MQ_SYSTEM_QUEUE_PLAN_TIME) {
// 在时间范围内,则返回大于等待时间的队列
if (timeUnit.unit >= waitTime) {
if (Math.abs(waitTime - prevUnit.unit) < Math.abs(timeUnit.unit - waitTime)) {
return prevUnit;
}
return timeUnit;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment