Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
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
黄奎
mall.oytour.com
Commits
b2bf93dc
Commit
b2bf93dc
authored
Sep 03, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
635e08de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
6 deletions
+27
-6
TimerJobj.cs
Mall.WebApi/Timers/TimerJobj.cs
+27
-6
No files found.
Mall.WebApi/Timers/TimerJobj.cs
View file @
b2bf93dc
...
...
@@ -49,13 +49,27 @@ namespace Mall.WebApi.Timers
DirectoryInfo
[]
dirArr
=
dir
.
GetDirectories
();
foreach
(
DirectoryInfo
item
in
dirArr
)
{
if
(
item
.
CreationTime
<
DateTime
.
Now
.
AddDays
(-
1
))
item
.
Delete
(
true
);
try
{
if
(
item
.
CreationTime
<
DateTime
.
Now
.
AddDays
(-
1
))
item
.
Delete
(
true
);
}
catch
(
Exception
)
{
LogHelper
.
Write
(
"删除临时文件夹失败:"
+
item
.
Name
);
}
}
foreach
(
FileInfo
fi
in
dir
.
GetFiles
())
{
if
(
fi
.
CreationTime
<
DateTime
.
Now
.
AddDays
(-
1
))
fi
.
Delete
();
try
{
if
(
fi
.
CreationTime
<
DateTime
.
Now
.
AddDays
(-
1
))
fi
.
Delete
();
}
catch
(
Exception
)
{
LogHelper
.
Write
(
"删除临时文件失败:"
+
fi
.
Name
);
}
}
#
region
二维码的
...
...
@@ -63,8 +77,15 @@ namespace Mall.WebApi.Timers
DirectoryInfo
QRdir
=
new
DirectoryInfo
(
rootBook
+
"/upfile/code"
);
foreach
(
FileInfo
fi
in
QRdir
.
GetFiles
())
{
if
(
fi
.
CreationTime
<
DateTime
.
Now
.
AddDays
(-
1
))
fi
.
Delete
();
try
{
if
(
fi
.
CreationTime
<
DateTime
.
Now
.
AddDays
(-
1
))
fi
.
Delete
();
}
catch
(
Exception
)
{
LogHelper
.
Write
(
"删除临时二维码失败:"
+
fi
.
Name
);
}
}
#
endregion
...
...
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