IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 24, 2010, 7:18:05 PM (16 years ago)
Author:
bills
Message:

order pending files by priority. Works but needs optimization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/warptool.c

    r28056 r28082  
    940940
    941941    // treat limit == 0 as "no limit"
    942     psString limitString = psStringCopy("\n");
     942    psString limitString = psStringCopy("\nORDER BY priority DESC, warp_id");
    943943    if (limit) {
    944         // We apply the limit to both sides of the UNION
    945         // to avoid slow queries and to the query itself
    946         // to satisfy the user's requested limit
     944        // We apply the limit to both sides of the UNION to avoid slow queries
     945        // and to the query itself to satisfy the user's requested limit
    947946        psStringAppend(&limitString, "%s", psDBGenerateLimitSQL(limit));
    948947        psStringAppend(&query, " %s", limitString);
    949948    }
    950949
    951 #define TWO_WHERES
    952 #ifdef TWO_WHERES
    953950    if (!p_psDBRunQueryF(config->dbh, query, whereStr, limitString, whereStr,  limitString)) {
    954951        psError(PS_ERR_UNKNOWN, false, "database error");
     
    956953        return false;
    957954    }
    958 #else
    959     if (!p_psDBRunQueryF(config->dbh, query, whereStr)) {
    960         psError(PS_ERR_UNKNOWN, false, "database error");
    961         psFree(query);
    962         return false;
    963     }
    964 #endif
    965955    psFree(limitString);
    966956    psFree(whereStr);
Note: See TracChangeset for help on using the changeset viewer.