Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
be998f94
Commit
be998f94
authored
Apr 07, 2026
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.7.21-临时文件延迟删除
parent
5327de79
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
TSocialFriendPushServiceImpl.java
...ifu/social/service/impl/TSocialFriendPushServiceImpl.java
+14
-4
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialFriendPushServiceImpl.java
View file @
be998f94
...
...
@@ -205,6 +205,12 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 此方法是:删除临时文件
public
void
cleanSpireTempFiles
()
{
try
{
// 暂停1分钟
try
{
Thread
.
sleep
(
60000
);
}
catch
(
InterruptedException
e
)
{
}
String
tempDirPath
=
System
.
getProperty
(
"java.io.tmpdir"
);
File
tempDir
=
new
File
(
tempDirPath
);
...
...
@@ -216,15 +222,19 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
if
(
spireTempFiles
!=
null
&&
spireTempFiles
.
length
>
0
)
{
int
count
=
0
;
long
totalSize
=
0
;
long
oneMinuteAgo
=
System
.
currentTimeMillis
()
-
60000
;
long
fileSize
;
for
(
File
file
:
spireTempFiles
)
{
if
(
file
.
isFile
()
&&
file
.
canWrite
())
{
long
fileSize
=
file
.
length
();
if
(
file
.
isFile
()
&&
file
.
canWrite
()
&&
file
.
lastModified
()
<
oneMinuteAgo
)
{
fileSize
=
file
.
length
();
if
(
file
.
delete
())
{
count
++;
totalSize
+=
fileSize
;
}
}
}
}
log
.
info
(
"清理 Spire.XLS 临时文件完成:删除 {} 个文件,释放 {} MB 空间"
,
count
,
totalSize
/
1024
/
1024
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment