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

1、 如上图代码, 在多线程请求下, client 会被重复创建和初始化 2、如果配置文件发生变化,ftp和sftp 在做refresh刷新的情况下,并没有close 掉原来的ftp或sftp, #709

Open
syubun opened this issue Nov 25, 2024 · 1 comment

Comments

@syubun
Copy link

syubun commented Nov 25, 2024

碰到问题,请在 https://github.com/YunaiV/ruoyi-vue-pro/issues 搜索是否存在相似的 issue。

不按照模板提交的 issue,会被系统自动删除。

基本信息

  • ruoyi-vue-pro 版本:
  • 操作系统:
  • 数据库:

image
@Override @SuppressWarnings("unchecked") public <Config extends FileClientConfig> void createOrUpdateFileClient(Long configId, Integer storage, Config config) { AbstractFileClient<Config> client = (AbstractFileClient<Config>) clients.get(configId); if (client == null) { client = this.createFileClient(configId, storage, config); client.init(); clients.put(client.getId(), client); } else { client.refresh(config); } }
1、 如上图代码, 在多线程请求下, client 会被重复创建和初始化
2、如果配置文件发生变化,ftp和sftp 在做refresh刷新的情况下,并没有close 掉原来的ftp或sftp,

@syubun
Copy link
Author

syubun commented Nov 25, 2024

而且 感觉 FTPClient 并不是线程安全的,多个线程下 ,应该不能使用同一个FTPClient吧。

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

No branches or pull requests

1 participant