db-campaign: Do only load completed pilots from variant

Since we know for which variant we want to have the completed pilots, we
do not have to catch all pilot_ids but only those who of pilots that are
finished and have the correct variant_id. This speeds the startup of the
campaign server enormously when having many completed campaigns in the
database.

Change-Id: I8be584a2dd6d8d7315f30dcb5bff89647353001e
This commit is contained in:
Christian Dietrich
2014-08-25 12:34:29 +02:00
parent a292e192ec
commit 268d9d4658
2 changed files with 11 additions and 5 deletions

View File

@ -29,7 +29,7 @@ class DatabaseCampaign : public Campaign {
int fspmethod_id; // !< Which fspmethod should be put out to the clients
void collect_result_thread();
void load_completed_pilots();
void load_completed_pilots(fail::Database::Variant);
unsigned existing_results_for_pilot(unsigned pilot_id);
#ifndef __puma