mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 09:35:29 +08:00
update 添加 renew 方法以支持续期当前延迟任务的到期时间
This commit is contained in:
parent
57f4eaa952
commit
7faa48f905
@ -60,6 +60,12 @@ public class SseEmitterDelayed implements Delayed {
|
||||
this.expireAt = Instant.now().toEpochMilli() + unit.toMillis(delay);
|
||||
}
|
||||
|
||||
/**
|
||||
* 续期当前延迟任务的到期时间
|
||||
*
|
||||
* @param delay 延迟时长(例如 30 表示 30 秒)
|
||||
* @param unit 时间单位(如秒、分钟等)
|
||||
*/
|
||||
public void renew(long delay, TimeUnit unit) {
|
||||
this.expireAt = System.currentTimeMillis() + unit.toMillis(delay);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user