liquid_feedback_core

diff lf_update.c @ 4:6133c0a62378

Version beta5

Precalculation of certain values to increase performance:
- Count of active members per area
- Count of active members altogether
- Count of people involved in the voting process for an issue

Minor bugfix in function close_voting(...) related to initiatives having no positive or negative votes
author jbe
date Sun Nov 15 12:00:00 2009 +0100 (2009-11-15)
parents 23092eb00e16
children bdccc56fb705
line diff
     1.1 --- a/lf_update.c	Sun Nov 15 12:00:00 2009 +0100
     1.2 +++ b/lf_update.c	Sun Nov 15 12:00:00 2009 +0100
     1.3 @@ -67,6 +67,20 @@
     1.4      return 1;
     1.5    }
     1.6  
     1.7 +  // calculate member counts:
     1.8 +  status = PQexec(db, "SELECT \"calculate_member_counts\"()");
     1.9 +  if (!status) {
    1.10 +    fprintf(stderr, "Error in pqlib while sending SQL command calculating member counts\n");
    1.11 +    return 1;
    1.12 +  }
    1.13 +  if (
    1.14 +    PQresultStatus(status) != PGRES_COMMAND_OK &&
    1.15 +    PQresultStatus(status) != PGRES_TUPLES_OK
    1.16 +  ) {
    1.17 +    fprintf(stderr, "Error while executing SQL command calculating member counts:\n%s", PQresultErrorMessage(status));
    1.18 +    return 1;
    1.19 +  }
    1.20 +
    1.21    // update open issues:
    1.22    list = PQexec(db, "SELECT \"id\" FROM \"open_issue\"");
    1.23    if (!list) {

Impressum / About Us