From f85475ee09b89f1ad1110320593ab7948e45b578 Mon Sep 17 00:00:00 2001 From: Ere Maijala <ere.maijala@helsinki.fi> Date: Mon, 29 Jan 2018 20:19:28 +0200 Subject: [PATCH] Allow fractional values in minimum expiration age. (#1104) --- .../src/VuFindConsole/Controller/UtilController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/module/VuFindConsole/src/VuFindConsole/Controller/UtilController.php b/module/VuFindConsole/src/VuFindConsole/Controller/UtilController.php index 245a532d5fa..e9eadd6324d 100644 --- a/module/VuFindConsole/src/VuFindConsole/Controller/UtilController.php +++ b/module/VuFindConsole/src/VuFindConsole/Controller/UtilController.php @@ -677,11 +677,11 @@ class UtilController extends AbstractBase /** * Abstract delete method. * - * @param string $tableName Table to operate on. - * @param string $successString String for reporting success. - * @param string $failString String for reporting failure. - * @param int $minAge Minimum age allowed for expiration (also used - * as default value). + * @param string $tableName Table to operate on. + * @param string $successString String for reporting success. + * @param string $failString String for reporting failure. + * @param int|float $minAge Minimum age allowed for expiration in days + * (also used as default value). * * @return mixed */ @@ -691,7 +691,7 @@ class UtilController extends AbstractBase $request = $this->getRequest(); // Use command line value as expiration age, or default to $minAge. - $daysOld = intval($request->getParam('daysOld', $minAge)); + $daysOld = floatval($request->getParam('daysOld', $minAge)); // Use command line values for batch size and sleep time if specified. $batchSize = $request->getParam('batch', 1000); -- GitLab