Do not lock the database while retrieving all the track features

This commit is contained in:
emeric
2019-03-10 14:13:59 +01:00
parent 99d592a71e
commit e609b239f3
6 changed files with 58 additions and 32 deletions
@@ -106,10 +106,10 @@ void
FeaturesScannerAddon::updateSearcher()
{
Wt::Dbo::Transaction transaction {_db.getSession()};
auto tracks {Database::Track::getAllWithFeatures(_db.getSession())};
std::vector<Database::IdType> trackIds {Database::Track::getAllIdsWithFeatures(_db.getSession())};
transaction.commit();
if (tracks.empty())
if (trackIds.empty())
{
LMS_LOG(DBUPDATER, INFO) << "No track suitable for features similarity clustering";
std::atomic_store(&_searcher, std::shared_ptr<FeaturesSearcher>{});