yangys
2024-04-24 11b76c76bcd4f235fb75959b53b64c6d9a2dd71e
smart-man-boot/src/main/java/com/qianwen/smartman/common/utils/DelayList.java
@@ -36,7 +36,7 @@
            return true;
        }
        if (o instanceof DelayList) {
            DelayList<?> other = (DelayList) o;
            DelayList<?> other = (DelayList<?>) o;
            if (other.canEqual(this) && getMaxWait() == other.getMaxWait() && getMaxLen() == other.getMaxLen()) {
                Object this$queue = getQueue();
                Object other$queue = other.getQueue();
@@ -105,13 +105,13 @@
    }
    public DelayList(int maxWait) {
        this.queue = new ArrayBlockingQueue(100000, true);
        this.queue = new ArrayBlockingQueue<>(100000, true);
        this.maxWait = maxWait;
        this.maxLen = 1000;
    }
    public DelayList(int maxWait, int maxLen) {
        this.queue = new ArrayBlockingQueue(100000, true);
        this.queue = new ArrayBlockingQueue<>(100000, true);
        this.maxWait = maxWait;
        this.maxLen = maxLen;
    }
@@ -125,7 +125,7 @@
        if (this.timer == null) {
            System.out.println("创建消费线程");
            this.timer = new Thread(() -> {
                ArrayList arrayList = new ArrayList();
                ArrayList<T> arrayList = new ArrayList<>();
                Queues.drainUninterruptibly(this.queue, arrayList, this.maxLen, this.maxWait, TimeUnit.SECONDS);
                if (arrayList.size() != 0) {
                    consumer.accept(arrayList);