Commit c19004896bd4135a2b972aaa73f73cfe7d74b662

Authored by Conrad Vermeulen
1 parent bbe2f301

KTS-2638

"index migration task should log start and stop as debug"
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7665 c91229c3-7414-0410-bfa2-8a42b809f60b
search2/indexing/indexerCore.inc.php
... ... @@ -977,8 +977,13 @@ abstract class Indexer
977 977  
978 978 public function migrateDocuments($max=null)
979 979 {
  980 + global $default;
  981 +
  982 + $default->log->debug(_kt('migrateDocuments: starting'));
  983 +
980 984 if (!$this->doesDiagnosticsPass(true))
981 985 {
  986 + $default->log->debug(_kt('migrateDocuments: stopping - diagnostics problem. The dashboard will provide more information.'));
982 987 return;
983 988 }
984 989  
... ... @@ -988,16 +993,14 @@ abstract class Indexer
988 993 $max = $config->get('indexer/batchMigrateDocument',500);
989 994 }
990 995  
991   - global $default;
992   -
993 996 $lockFile = $config->get('cache/cacheDirectory') . '/migration.lock';
994 997 if (is_file($lockFile))
995 998 {
996   - $default->log->info(_kt('migrateDocuments: migration lockfile detected. exiting.'));
  999 + $default->log->info(_kt('migrateDocuments: stopping - migration lockfile detected.'));
997 1000 return;
998 1001 }
999 1002 touch($lockFile);
1000   - $default->log->info(_kt('migrateDocuments: starting!'));
  1003 + $default->log->debug(_kt('migrateDocuments: starting!'));
1001 1004  
1002 1005 $startTime = KTUtil::getSystemSetting('migrationStarted');
1003 1006 if (is_null($startTime))
... ... @@ -1025,12 +1028,14 @@ abstract class Indexer
1025 1028 $result = DBUtil::getResultArray($sql);
1026 1029 if (PEAR::isError($result))
1027 1030 {
  1031 + $default->log->info(_kt('migrateDocuments: db error'));
1028 1032 break;
1029 1033 }
1030 1034  
1031 1035 $docs = count($result);
1032 1036 if ($docs == 0)
1033 1037 {
  1038 + $default->log->info(_kt('migrateDocuments: no more documents to migrate'));
1034 1039 $noDocs = true;
1035 1040 break;
1036 1041 }
... ... @@ -1086,13 +1091,12 @@ abstract class Indexer
1086 1091 KTUtil::setSystemSetting('migrationTime', KTUtil::getSystemSetting('migrationTime',0) + $time);
1087 1092 KTUtil::setSystemSetting('migratedDocuments', KTUtil::getSystemSetting('migratedDocuments',0) + $numDocs);
1088 1093  
1089   - $default->log->info(sprintf(_kt('migrateDocuments: done in %d seconds!'), $time));
  1094 + $default->log->debug(sprintf(_kt('migrateDocuments: stopping - done in %d seconds!'), $time));
1090 1095 if ($noDocs)
1091 1096 {
1092 1097 $default->log->info(_kt('migrateDocuments: Completed!'));
1093 1098 KTUtil::setSystemSetting('migrationComplete', true);
1094 1099 }
1095   -
1096 1100 }
1097 1101  
1098 1102 /**
... ...