Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void start() {
} catch (Exception e) {
log.error("worker run occur error", e);
}
}, 30, 5, TimeUnit.SECONDS);
}, 30, properties.scheduleWorkerDelayMs, TimeUnit.MILLISECONDS);

started = true;
log.info("worker started successfully");
Expand Down Expand Up @@ -90,6 +90,15 @@ public static class Properties {
private List<String> queues;
private String takeStrategy;
private int size = 1;
private int scheduleWorkerDelayMs = 100;

// Properties类中添加验证
public void setScheduleWorkerDelayMs(int scheduleWorkerDelayMs) {
if (scheduleWorkerDelayMs < 50) {
throw new IllegalArgumentException("scheduleWorkerDelayMs must be at least 50ms");
}
this.scheduleWorkerDelayMs = scheduleWorkerDelayMs;
}
}

}