mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user