Commit 60a22c1b authored by hongguangwu's avatar hongguangwu

1.7.21-优化

parent b47e1ded
...@@ -117,6 +117,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -117,6 +117,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
@Override @Override
public R<String> pushFriend(List<String> dispatchIdList, List<String> pushDispatchIdList, Integer isAuto, String userId) { public R<String> pushFriend(List<String> dispatchIdList, List<String> pushDispatchIdList, Integer isAuto, String userId) {
if (atomicPushFriend.incrementAndGet() <= 1) { if (atomicPushFriend.incrementAndGet() <= 1) {
// 先清理上一次的文件
cleanSpireTempFiles();
try { try {
TSocialFreindSet set = tSocialFreindSetService.getById("1"); TSocialFreindSet set = tSocialFreindSetService.getById("1");
if (set != null && Common.isNotNull(set.getType()) && 1 == set.getType()) { if (set != null && Common.isNotNull(set.getType()) && 1 == set.getType()) {
...@@ -190,7 +192,6 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -190,7 +192,6 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
} }
} finally { } finally {
atomicPushFriend.decrementAndGet(); atomicPushFriend.decrementAndGet();
cleanSpireTempFiles();
} }
return R.ok(); return R.ok();
} else { } else {
......
...@@ -90,7 +90,12 @@ public class ExcelToImage { ...@@ -90,7 +90,12 @@ public class ExcelToImage {
return R.failed(CommonConstants.RESULT_DATA_FAIL+toImagConvertError+e.getMessage()); return R.failed(CommonConstants.RESULT_DATA_FAIL+toImagConvertError+e.getMessage());
} finally { } finally {
if (wb != null) { if (wb != null) {
wb.dispose(); // 重要:释放资源并删除临时文件 try {
wb.dispose();
Thread.sleep(100);
} catch (Exception e) {
e.printStackTrace();
}
} }
if (tempFile != null && tempFile.exists()){ if (tempFile != null && tempFile.exists()){
tempFile.delete(); tempFile.delete();
......
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