File tree Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -1108,14 +1108,13 @@ function addDailyChanges(int $projectid): void
1108
1108
' , [$ projectid , $ date ]);
1109
1109
1110
1110
// Clean the backup directories.
1111
- $ timeframe = config ('cdash.backup_timeframe ' );
1111
+ $ deletion_time_threshold = time () - ( int ) config ('cdash.backup_timeframe ' ) * 3600 ;
1112
1112
$ dirs_to_clean = ['parsed ' , 'failed ' , 'inprogress ' ];
1113
1113
foreach ($ dirs_to_clean as $ dir_to_clean ) {
1114
1114
$ files = Storage::allFiles ($ dir_to_clean );
1115
- foreach ($ files as $ filename ) {
1116
- $ filepath = Storage::path ($ filename );
1117
- if (file_exists ($ filepath ) && is_file ($ filepath ) && time () - filemtime ($ filepath ) > $ timeframe * 3600 ) {
1118
- Storage::delete ($ filepath );
1115
+ foreach ($ files as $ file ) {
1116
+ if (Storage::lastModified ($ file ) < $ deletion_time_threshold ) {
1117
+ Storage::delete ($ file );
1119
1118
}
1120
1119
}
1121
1120
}
Original file line number Diff line number Diff line change @@ -14012,11 +14012,6 @@ parameters:
14012
14012
count: 3
14013
14013
path: app/cdash/include/dailyupdates.php
14014
14014
14015
- -
14016
- message: "#^Binary operation \"\\*\" between mixed and 3600 results in an error\\.$#"
14017
- count: 1
14018
- path: app/cdash/include/dailyupdates.php
14019
-
14020
14015
-
14021
14016
message: """
14022
14017
#^Call to deprecated function add_last_sql_error\\(\\)\\:
@@ -14092,6 +14087,11 @@ parameters:
14092
14087
count: 1
14093
14088
path: app/cdash/include/dailyupdates.php
14094
14089
14090
+ -
14091
+ message: "#^Cannot cast mixed to int\\.$#"
14092
+ count: 1
14093
+ path: app/cdash/include/dailyupdates.php
14094
+
14095
14095
-
14096
14096
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
14097
14097
count: 5
@@ -14312,11 +14312,6 @@ parameters:
14312
14312
count: 2
14313
14313
path: app/cdash/include/dailyupdates.php
14314
14314
14315
- -
14316
- message: "#^Only numeric types are allowed in \\-, int\\|false given on the right side\\.$#"
14317
- count: 1
14318
- path: app/cdash/include/dailyupdates.php
14319
-
14320
14315
-
14321
14316
message: "#^Parameter \\#1 \\$datetime of function strtotime expects string, string\\|null given\\.$#"
14322
14317
count: 1
You can’t perform that action at this time.
0 commit comments