File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -1507,17 +1507,10 @@ def clear_tmp(self):
15071507 week_ago = 60 * 60 * 24 * 7
15081508 dir = self .tempDir
15091509 for f in os .listdir (dir ):
1510- prefix = f .split ('_' )[0 ]
1511- if prefix .isdigit ():
1512- ts = int (prefix )
1513- if ts < time .time () - week_ago :
1514- count += 1
1515- os .remove (os .path .join (dir , f ))
1516- elif prefix == 'checkload' :
1517- ts = int (f .split ('_' )[1 ])
1518- if ts < time .time () - week_ago :
1519- count += 1
1520- os .remove (os .path .join (dir , f ))
1510+ ts = os .path .getmtime (os .path .join (dir , f ))
1511+ if ts < time .time () - week_ago :
1512+ count += 1
1513+ os .remove (os .path .join (dir , f ))
15211514
15221515 self .local .add_log (f"Removed { count } old files from tmp dir for { int (time .time () - start )} seconds" , "info" )
15231516
You can’t perform that action at this time.
0 commit comments