Compare commits
4
Commits
2e54e3d651
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae41240806
|
||
|
|
cb7fdb4f19
|
||
|
|
3d1896bd64
|
||
|
|
0e0d2b03cc
|
+2
-2
@@ -16,10 +16,10 @@
|
||||
# ProjectName mingli-utils
|
||||
# ModuleName mingli-utils
|
||||
# CurrentFile gradle.properties
|
||||
# LastUpdate 2026-11-18 08:38:45
|
||||
# LastUpdate 2026-11-18 19:46:50
|
||||
# UpdateUser MingLiPro
|
||||
#
|
||||
JDKVERSIONS=17
|
||||
GROUPSID=com.mingliqiye.utils
|
||||
ARTIFACTID=mingli-utils
|
||||
VERSIONS=5.5.4
|
||||
VERSIONS=5.5.5
|
||||
|
||||
+3
-2
@@ -23,7 +23,6 @@
|
||||
package com.mingliqiye.utils.springboot.autoconfigure
|
||||
|
||||
import com.mingliqiye.utils.logger.MingLiLoggerFactory
|
||||
import com.mingliqiye.utils.springboot.annotation.ContextClosedEventListener
|
||||
import com.mingliqiye.utils.springboot.autoconfigure.builder.OkhttpBuilder
|
||||
import org.slf4j.Logger
|
||||
import org.springframework.beans.factory.ObjectProvider
|
||||
@@ -32,6 +31,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.event.ContextClosedEvent
|
||||
import org.springframework.context.event.EventListener
|
||||
|
||||
/**
|
||||
* OkHttp 3 的 Spring Boot 自动配置。
|
||||
@@ -118,7 +118,8 @@ open class Okhttp3AutoConfiguration {
|
||||
* 仅当 [okhttp] 字段非空(即客户端由本配置创建)时执行;
|
||||
* 调用方自行声明的客户端不会被清理。
|
||||
*/
|
||||
@ContextClosedEventListener
|
||||
|
||||
@EventListener(ContextClosedEvent::class)
|
||||
open fun handleContextClosed() {
|
||||
okhttp?.let {
|
||||
log.info("Context closed, cleaning up OkHttpClient...")
|
||||
|
||||
Reference in New Issue
Block a user