[tools] testbot/Janitor: Round the file age down when purging.

Francois Gouget fgouget at codeweavers.com
Tue Apr 13 05:24:06 CDT 2021


There is not much point in rounding to nearest and rounding down is
simpler.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
Obsolete files will stay around an extra 12 hours on average. That 
shouldn't make any difference.
---
 testbot/bin/Janitor.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testbot/bin/Janitor.pl b/testbot/bin/Janitor.pl
index 35a7e5d4f..c68920e7c 100755
--- a/testbot/bin/Janitor.pl
+++ b/testbot/bin/Janitor.pl
@@ -269,7 +269,7 @@ if (opendir(my $dh, "$DataDir/staging"))
 
     $Entry =~ m%^([^/]+)$%; # untaint
     my $FileName = "$DataDir/staging/$1";
-    my $Age = int((-M $FileName) + 0.5);
+    my $Age = int(-M $FileName);
     my $TTL = $JobPurgeDays ? $JobPurgeDays - $Age : undef;
 
     # FIXME: There are still some obsolete unexpired 31 characters session ids.
@@ -326,7 +326,7 @@ if (opendir(my $dh, "$DataDir/latest"))
 
     $Entry =~ m%^([^/]+)$%; # untaint
     my $FileName = "$DataDir/latest/$1";
-    my $Age = int((-M $FileName) + 0.5);
+    my $Age = int(-M $FileName);
     my $TTL = $JobPurgeDays ? $JobPurgeDays - $Age : undef;
 
     # Keep the regexp in sync with WineTestBot::Task::GetRefReportName()
-- 
2.20.1




More information about the wine-devel mailing list