fix 修复 关闭应用sse销毁报错问题

2.X
疯狂的狮子Li 6 months ago
parent d40eb399f9
commit d58be8927f

@ -6,6 +6,7 @@ import org.dromara.common.core.domain.R;
import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.sse.core.SseEmitterManager; import org.dromara.common.sse.core.SseEmitterManager;
import org.dromara.common.sse.dto.SseMessageDto; import org.dromara.common.sse.dto.SseMessageDto;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -17,7 +18,7 @@ import java.util.List;
@RestController @RestController
@ConditionalOnProperty(value = "sse.enabled", havingValue = "true") @ConditionalOnProperty(value = "sse.enabled", havingValue = "true")
@RequiredArgsConstructor @RequiredArgsConstructor
public class SseController { public class SseController implements DisposableBean {
private final SseEmitterManager sseEmitterManager; private final SseEmitterManager sseEmitterManager;
@ -51,4 +52,9 @@ public class SseController {
return R.ok(); return R.ok();
} }
@Override
public void destroy() throws Exception {
// 销毁时不需要做什么 此方法避免无用操作报错
}
} }

Loading…
Cancel
Save