Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
f858aa22
Commit
f858aa22
authored
Dec 01, 2022
by
wanglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
每天定时删除二维码图片
parent
e9a47264
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
CylinderSchedulerJob.java
...amos/boot/module/ugp/api/quartz/CylinderSchedulerJob.java
+43
-0
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/quartz/CylinderSchedulerJob.java
0 → 100644
View file @
f858aa22
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
quartz
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.io.File
;
@Component
@EnableScheduling
public
class
CylinderSchedulerJob
{
/**
* 每天3点-删除图片
*/
@Scheduled
(
cron
=
"${cylinder-early-warning-cron:0 0 3 * * ?}"
)
public
void
clean
()
{
dayReport
(
new
File
(
new
File
(
"/home/yeejoin/ugp/minio-data/upload/common/ugp/qrcode"
).
getAbsolutePath
()));
}
public
static
void
dayReport
(
File
file
)
{
// file.isAbsolute();
if
(!
ValidationUtil
.
isEmpty
(
file
.
listFiles
()))
{
for
(
File
f
:
file
.
listFiles
())
{
//实现递归
if
(
f
.
isDirectory
())
{
dayReport
(
f
);
}
//清理文件
f
.
delete
();
System
.
out
.
println
(
f
.
getName
()
+
"已清理!!!"
);
}
}
}
// public static void main(String[] args) {
//
// dayReport(new File(new File("/home/yeejoin/ugp/minio-data/upload/common/ugp/qrcode").getAbsolutePath()));
// }
}
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