Upgrade should only try once

.. since it prohibits startup when fails.
.. suspect there is an issue with optimise() on a new index
.. have also added more logging to watch this.
This commit is contained in:
Mark Liversedge
2013-05-21 06:54:53 +01:00
parent eefcca677a
commit ac4962bc89
2 changed files with 11 additions and 4 deletions

View File

@@ -56,6 +56,9 @@ GcUpgrade::upgrade(const QDir &home)
// 4. Set default weight to 75kg if currently zero
double weight_ = appsettings->cvalue(home.dirName(), GC_WEIGHT, "75.0").toString().toDouble();
if (weight_ <= 0.00) appsettings->setCValue(home.dirName(), GC_WEIGHT, "75.0");
// 5. Set latest version - so only tries to upgrade once
appsettings->setCValue(home.dirName(), GC_VERSION_USED, VERSION_LATEST);
}
}
return 0;

View File

@@ -188,18 +188,22 @@ void MetricAggregator::refreshMetrics(QDateTime forceAfterThisDate)
}
}
// stop logging
out << "METRIC REFRESH ENDS: " << QDateTime::currentDateTime().toString() + "\r\n";
log.close();
// end LUW -- now syncs DB
out << "COMMIT: " << QDateTime::currentDateTime().toString() + "\r\n";
dbaccess->connection().commit();
#ifdef GC_HAVE_LUCENE
out << "OPTIMISE: " << QDateTime::currentDateTime().toString() + "\r\n";
main->lucene->optimise();
#endif
main->isclean = true;
// stop logging
out << "SIGNAL DATA CHANGED: " << QDateTime::currentDateTime().toString() + "\r\n";
dataChanged(); // notify models/views
out << "METRIC REFRESH ENDS: " << QDateTime::currentDateTime().toString() + "\r\n";
log.close();
}
/*----------------------------------------------------------------------