Skip to content

Commit 5d0a034

Browse files
authored
[Bug] Cast prune_results_older_than as integer (alexjustesen#2025)
1 parent 7306500 commit 5d0a034

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

config/speedtest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
'content_width' => env('CONTENT_WIDTH', '7xl'),
1515

16-
'prune_results_older_than' => env('PRUNE_RESULTS_OLDER_THAN', 0),
16+
'prune_results_older_than' => (int) env('PRUNE_RESULTS_OLDER_THAN', 0),
1717

1818
'public_dashboard' => env('PUBLIC_DASHBOARD', false),
1919

routes/console.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
/**
77
* Checks if Result model records should be pruned.
88
*/
9-
if (config('speedtest.prune_results_older_than') > 0) {
10-
Schedule::command('model:prune', [
11-
'--model' => [\App\Models\Result::class],
12-
])->daily();
13-
}
9+
Schedule::command('model:prune')
10+
->daily()
11+
->when(function () {
12+
return config('speedtest.prune_speedtests_older_than') > 0;
13+
});
1414

1515
/**
1616
* Checked for new versions weekly on Thursday because

0 commit comments

Comments
 (0)