Commit 3ea58d5e5f7080ccfdc95ead89c58a3d23433d44
1 parent
bfb54a35
KTS-3181
"Scheduler: Migration process fails" Fixed. Divide by 1 if migrated documents is 0 Committed By: Megan Watson Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8317 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
4 additions
and
1 deletions
plugins/search2/MigrationDashlet.php
| @@ -87,7 +87,10 @@ class LuceneMigrationDashlet extends KTBaseDashlet | @@ -87,7 +87,10 @@ class LuceneMigrationDashlet extends KTBaseDashlet | ||
| 87 | $migrationStartString = date('Y-m-d H:i:s', $migrationStart); | 87 | $migrationStartString = date('Y-m-d H:i:s', $migrationStart); |
| 88 | $migrationTime = KTUtil::getSystemSetting('migrationTime',0); | 88 | $migrationTime = KTUtil::getSystemSetting('migrationTime',0); |
| 89 | $migrationPeriod = KTUtil::computePeriod($migrationTime, ''); | 89 | $migrationPeriod = KTUtil::computePeriod($migrationTime, ''); |
| 90 | - $timePerDocument = $migrationTime / ($migratedDocuments > 0) ? $migratedDocuments : 1; | 90 | + |
| 91 | + // Cannot divide by zero so make it 1 | ||
| 92 | + $divMigratedDocuments = ($migratedDocuments > 0) ? $migratedDocuments : 1; | ||
| 93 | + $timePerDocument = $migrationTime / $divMigratedDocuments; | ||
| 91 | $estimatedPeriod = $timePerDocument * $migratingDocuments; | 94 | $estimatedPeriod = $timePerDocument * $migratingDocuments; |
| 92 | $estimatedTime = date('Y-m-d H:i:s', $migrationStart + $estimatedPeriod); | 95 | $estimatedTime = date('Y-m-d H:i:s', $migrationStart + $estimatedPeriod); |
| 93 | $estimatedPeriod = KTUtil::computePeriod($estimatedPeriod, ''); | 96 | $estimatedPeriod = KTUtil::computePeriod($estimatedPeriod, ''); |