Commit ccbbccb2 authored by yanzg's avatar yanzg

修复等待时间

parent a12d4b9e
......@@ -11,8 +11,9 @@ import com.yanzuoguang.util.vo.Ref;
*/
public class YzgTimeout {
public static final long TIME_OUT_DEFAULT = 5000;
public static final int TIME_OUT_TIP = 1000;
public static final long TIME_OUT_DEFAULT = 15 * 1000;
public static final int TIME_OUT_TIP = 10 * 1000;
public static final int TIME_OUT_UNIT = 10;
/**
* 超时监控
......@@ -26,14 +27,14 @@ public class YzgTimeout {
ThreadHelper.runThread(() -> {
try {
long timeMax = TIME_OUT_DEFAULT;
int timeUnit = 10;
long start = System.currentTimeMillis();
do {
ThreadHelper.sleep(timeUnit);
ThreadHelper.sleep(TIME_OUT_UNIT);
long end = System.currentTimeMillis();
if (end - start > timeMax) {
timeUnit = TIME_OUT_TIP;
Log.error(cls, message + "超时,正在等待执行完成");
long time = end - start;
if (time > timeMax) {
timeMax += TIME_OUT_TIP;
Log.error(cls, "%s超时,已经执行%d豪秒,正在等待执行完成", message, time);
}
} while (!isRun.value);
} catch (Exception ex) {
......
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