5 Star 98 Fork 108

奇文社区 / ufop-spring-boot-starter

 / 详情

com.qiwenshare.ufop.util.UFOPUtils 异常

待办的
创建于  
2022-08-17 10:45

com.qiwenshare.ufop.util.UFOPUtils中

public static String getUploadFileUrl(String identifier, String extendName) {
        SimpleDateFormat formater = new SimpleDateFormat("yyyyMMdd");
        String path = ROOT_PATH + "/" + formater.format(new Date()) + "/";
        File dir = new File(getStaticPath() + path);
        if (!dir.exists()) {
            boolean result = dir.mkdirs();
            if (!result) {
                throw new UFOPException("创建upload目录失败:目录路径:" + dir.getPath());
            }
        }

        path = path + identifier + "." + extendName;
        return path;
    }

在并发的时候,比如上传文件夹的时候,就会跑异常。 因为判断目录是否存在,和创建目录是两步,并发的时候。就出现异常了。望修复

评论 (0)

李勃 创建了任务

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(1)
Java
1
https://gitee.com/qiwen-cloud/ufop-spring-boot-starter.git
git@gitee.com:qiwen-cloud/ufop-spring-boot-starter.git
qiwen-cloud
ufop-spring-boot-starter
ufop-spring-boot-starter

搜索帮助