mirror of
https://gitee.com/dromara/hutool.git
synced 2025-11-24 08:33:22 +08:00
修复JschSessionPool并发问题(pr#4079@Github)
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
* 【cron 】 修复`CronPatternUtil.nextDateAfter`当日为L时计算错误问题。(issue#4056@Github)
|
||||
* 【db 】 修复`NamedSql.replaceVar`关键字处理问题(issue#4062@Github)
|
||||
* 【db 】 修复`DialectRunner.count`方法中,去除包含多字段order by子句的SQL语句时错误问题(issue#4066@Github)
|
||||
* 【extra 】 修复`JschSessionPool`并发问题(pr#4079@Github)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
# 5.8.40(2025-08-26)
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.jcraft.jsch.Session;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* Jsch会话池
|
||||
@@ -14,12 +13,16 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
* @author looly
|
||||
*/
|
||||
public enum JschSessionPool {
|
||||
|
||||
/**
|
||||
* 单例对象
|
||||
*/
|
||||
INSTANCE;
|
||||
|
||||
/**
|
||||
* SSH会话池,key:host,value:Session对象
|
||||
*/
|
||||
private final SimpleCache<String, Session> cache = new SimpleCache<>(new ConcurrentHashMap<>());
|
||||
private final SimpleCache<String, Session> cache = new SimpleCache<>();
|
||||
|
||||
/**
|
||||
* 获取Session,不存在返回null
|
||||
|
||||
Reference in New Issue
Block a user