Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support ssh protocol config choose if reuse connection #1136

Merged
merged 8 commits into from
Jul 28, 2023

Conversation

tomsun28
Copy link
Contributor

What's changed?

support ssh protocol config choose if reuse connection

reuseConnection

    ssh:
      host: ^_^host^_^
      port: ^_^port^_^
      username: ^_^username^_^
      password: ^_^password^_^
      privateKey: ^_^privateKey^_^
      timeout: ^_^timeout^_^
      reuseConnection: ^_^reuseConnection^_^

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed

@@ -159,6 +159,7 @@ private void cleanTimeoutCache() {
* @param timeDiff 缓存对象保存时间 millis
*/
public void addCache(Object key, Object value, Long timeDiff) {
removeCache(key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉这个加着怪怪的

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是为了把之前老的cache对象 remove掉 让它走一遍回调接口 CacheCloseable -> close 来清理对象关闭连接资源

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我知道,我的意思,一般缓存的remove都是和add同级的,很少会在addCache里面调用remove,宁可其他地方调用的时候先调用remove,再调用addCache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants