diff --git a/.env.example b/.env.example index 68c643d579..4d17b2f1cb 100755 --- a/.env.example +++ b/.env.example @@ -25,11 +25,6 @@ DB_PASSWORD=secret # Should CDash automatically remove old builds? #AUTOREMOVE_BUILDS=true -# How many builds should CDash try to remove per iteration? -# Consider tweaking this value if you notice the autoremove queries -# are slow to execute. -#AUTOREMOVE_BUILDS_BATCH_SIZE=10 - # How long should CDash store parsed input files (in hours?) # Set to 0 if you do not wish to backup parsed submission files. #BACKUP_TIMEFRAME=48 diff --git a/app/Utils/DatabaseCleanupUtils.php b/app/Utils/DatabaseCleanupUtils.php index 4ec5ac895a..c37513ac8e 100644 --- a/app/Utils/DatabaseCleanupUtils.php +++ b/app/Utils/DatabaseCleanupUtils.php @@ -150,21 +150,16 @@ public static function removeBuild($buildid) : void } /** - * Call removeBuild() in batches. - * @param array|int $buildid + * Call removeBuild() one at a time. + * @param array|int $buildids */ - public static function removeBuildChunked($buildid): void + public static function removeBuildChunked($buildids): void { - if (!is_array($buildid)) { - self::removeBuild($buildid); + if (!is_array($buildids)) { + self::removeBuild($buildids); } - - $batch_size = (int) config('cdash.autoremove_builds_batch_size'); - if ($batch_size < 1) { - $batch_size = 1; - } - foreach (array_chunk($buildid, $batch_size) as $chunk) { - self::removeBuild($chunk); + foreach ($buildids as $buildid) { + self::removeBuild($buildid); usleep(1); } } diff --git a/config/cdash.php b/config/cdash.php index f949da3695..129d7a9e98 100755 --- a/config/cdash.php +++ b/config/cdash.php @@ -48,7 +48,6 @@ ], 'active_project_days' => env('ACTIVE_PROJECT_DAYS', 7), 'autoremove_builds' => env('AUTOREMOVE_BUILDS', true), - 'autoremove_builds_batch_size' => env('AUTOREMOVE_BUILDS_BATCH_SIZE', 10), 'backup_timeframe' => env('BACKUP_TIMEFRAME', 48), 'builds_per_project' => env('BUILDS_PER_PROJECT', 0), 'coverage_dir' => env('CDASH_COVERAGE_DIR', '/cdash/_build/xdebugCoverage'),