IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 20, 2019, 10:20:26 AM (7 years ago)
Author:
eugene
Message:

allow addstar_multi_run to limit the number of cmf files loaded at one time

File:
1 edited

Legend:

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

    r39528 r40803  
    138138    PXOPT_LOOKUP_BOOL(destreaked, config->args, "-destreaked", false);
    139139    PXOPT_LOOKUP_BOOL(uncensored, config->args, "-uncensored", false);
     140
     141    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     142
    140143    PXOPT_LOOKUP_BOOL(pretend,    config->args, "-pretend", false);
    141144    PXOPT_LOOKUP_BOOL(simple,     config->args, "-simple", false);
     
    421424      psStringAppend(&query, " GROUP BY ff_id ");  //needs to be checked, but should be fine: want 1 ff summary cmf.
    422425    }
     426
     427    // treat limit == 0 as "no limit"
     428    if (limit) {
     429        psString limitString = psDBGenerateLimitSQL(limit);
     430        psStringAppend(&query, " %s", limitString);
     431        psFree(limitString);
     432    }
     433
    423434    psError(PS_ERR_UNKNOWN, false, "query: %s\n", query);
    424435
     
    12091220      PXOPT_COPY_STR(config->args, where, "-stage", "addRun.stage","==");
    12101221      PXOPT_COPY_S64(config->args, where, "-stage_id", "addRun.stage_id", "==");
     1222
    12111223      //PXOPT_LOOKUP_S64(stage_id, config->args, "-stage_id", false, false);
    12121224    } else {
     
    12311243    psFree(where);
    12321244   
     1245    if (multiadd) {
     1246      // optional -stage_extra1_list extra1,extra1,extra1 to restrict
     1247      PXOPT_LOOKUP_STR(stage_extra1_list, config->args, "-stage_extra1_list", false, false);
     1248      if (stage_extra1_list) {
     1249        psStringAppend(&query, " AND stage_extra1 IN (%s)", stage_extra1_list);
     1250      }
     1251    }
     1252
     1253
    12331254    //if (multiadd) {
    12341255    //  psStringAppend(&query, "group by  %s", "stage_extra1");
Note: See TracChangeset for help on using the changeset viewer.