Commit 61c672a0 authored by fangxinjiang's avatar fangxinjiang

附件上传限流-fxj

parent dc2630dd
......@@ -260,7 +260,7 @@ public class FileUploadServiceImpl implements FileUploadService {
public R getR(MultipartFile file, String filePath, Integer type, String domain, String uploadType) {
if (atomicInteger.intValue() < maxLimit){
try {
atomicInteger.getAndAdd(1);
atomicInteger.incrementAndGet();
Thread.sleep(1000);
log.error("atomicInteger+1:"+atomicInteger.intValue());
if (CommonConstants.ZERO_STRING.equals(uploadType)){
......@@ -271,7 +271,7 @@ public class FileUploadServiceImpl implements FileUploadService {
}catch (Exception e){
log.error("附件上传异常:",e);
}finally {
atomicInteger.getAndAdd(-1);
atomicInteger.decrementAndGet();
log.error("atomicInteger-1:"+atomicInteger.intValue());
}
}else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment