IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 17, 2010, 4:40:03 PM (16 years ago)
Author:
Paul Price
Message:

Reworked all ippTools to put fault=2 (SYS_ERROR) when can't find SQL file (presumably due to NFS problems). Removed DATA_ERROR because ippTools don't work on data (astronomical images or catalogues). This should allow us to turn on revert for fault=2 only.

File:
1 edited

Legend:

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

    r25324 r26981  
    3535    psString query = pxDataGet("dettool_todetrunsummary.sql");
    3636    if (!query) {
    37         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     37        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    3838        return false;
    3939    }
     
    135135    psString query = pxDataGet("dettool_find_completed_runs.sql");
    136136    if (!query) {
    137         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     137        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    138138        return false;
    139139    }
     
    241241    psString query = pxDataGet("dettool_detrunsummary.sql");
    242242    if (!query) {
    243         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     243        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    244244        psFree(where);
    245245        return false;
     
    310310    psString query = pxDataGet("dettool_revertdetrunsummary.sql");
    311311    if (!query) {
    312         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     312        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    313313        return false;
    314314    }
     
    348348  psString query = pxDataGet("dettool_pendingcleanup_detrunsummary.sql");
    349349  if (!query) {
    350     psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     350    psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    351351    return(false);
    352352  }
    353  
     353
    354354  if (psListLength(where->list)) {
    355355    psString whereClause = psDBGenerateWhereConditionSQL(where, "detRunSummary");
     
    429429
    430430/*       if (!isValidDataState(data_state)) return false; */
    431      
    432      
    433      
     431
     432
     433
    434434      char *query_detRunSummary = "UPDATE detRunSummary SET data_state = '%s'"
    435         " WHERE det_id = %" PRId64
    436         " AND iteration = %" PRId32;
     435        " WHERE det_id = %" PRId64
     436        " AND iteration = %" PRId32;
    437437      if (!p_psDBRunQueryF(config->dbh, query_detRunSummary, data_state, det_id,iteration)) {
    438         psError(PS_ERR_UNKNOWN, false,
    439                 "failed to change state for det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
    440         return false;
     438        psError(PS_ERR_UNKNOWN, false,
     439                "failed to change state for det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
     440        return false;
    441441      }
    442442
    443443      /* This check allows the one update to flag everything for cleanup.  The check for full is only temporary while I test for bugs. */
    444444      if ((!strncmp(data_state,"goto_",5)
    445            //      || (!strcmp(data_state,"full"))
    446            //      || (!strcmp(data_state,"cleaned"))
    447            ))   {
    448         char *query_detProcessedImfile = "UPDATE detProcessedImfile SET data_state = '%s'"
    449           " WHERE det_id = %" PRId64;
    450         if (!p_psDBRunQueryF(config->dbh, query_detProcessedImfile,data_state,det_id)) {
    451           psError(PS_ERR_UNKNOWN, false,
    452                   "failed to change state for detProcessedImfile det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
    453           return(false);
    454         }
    455        
    456         char *query_detProcessedExp = "UPDATE detProcessedExp SET data_state = '%s'"
    457           " WHERE det_id = %" PRId64;
    458         if (!p_psDBRunQueryF(config->dbh, query_detProcessedExp,data_state,det_id)) {
    459           psError(PS_ERR_UNKNOWN, false,
    460                   "failed to change state for detProcessedExp det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
    461           return(false);
    462         }
    463        
    464         char *query_detNormalizedImfile = "UPDATE detNormalizedImfile SET data_state = '%s'"
    465           " WHERE det_id = %" PRId64
    466           " AND iteration = %" PRId32;
    467         if (!p_psDBRunQueryF(config->dbh, query_detNormalizedImfile,data_state,det_id,iteration)) {
    468           psError(PS_ERR_UNKNOWN, false,
    469                   "failed to change state for detNormalizedImfile det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
    470           return(false);
    471         }
    472        
    473         char *query_detNormalizedStatImfile = "UPDATE detNormalizedStatImfile SET data_state = '%s'"
    474           " WHERE det_id = %" PRId64
    475           " AND iteration = %" PRId32;
    476         if (!p_psDBRunQueryF(config->dbh, query_detNormalizedStatImfile,data_state,det_id,iteration)) {
    477           psError(PS_ERR_UNKNOWN, false,
    478                   "failed to change state for detNormalizedStatImfile det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
    479           return(false);
    480         }
    481 
    482         char *query_detNormalizedExp = "UPDATE detNormalizedExp SET data_state = '%s'"
    483           " WHERE det_id = %" PRId64
    484           " AND iteration = %" PRId32;
    485         if (!p_psDBRunQueryF(config->dbh, query_detNormalizedExp,data_state,det_id,iteration)) {
    486           psError(PS_ERR_UNKNOWN, false,
    487                   "failed to change state for detNormalizedExp det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
    488           return(false);
    489         }
    490        
    491         char *query_detResidImfile = "UPDATE detResidImfile SET data_state = '%s'"
    492           " WHERE det_id = %" PRId64
    493           " AND iteration = %" PRId32;
    494         if (!p_psDBRunQueryF(config->dbh, query_detResidImfile,data_state,det_id,iteration)) {
    495           psError(PS_ERR_UNKNOWN, false,
    496                   "failed to change state for detResidImfile det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
    497           return(false);
    498         }
    499        
    500         char *query_detResidExp = "UPDATE detResidExp SET data_state = '%s'"
    501           " WHERE det_id = %" PRId64
    502           " AND iteration = %" PRId32;
    503         if (!p_psDBRunQueryF(config->dbh, query_detResidExp,data_state,det_id,iteration)) {
    504           psError(PS_ERR_UNKNOWN, false,
    505                   "failed to change state for detResidExp det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
    506           return(false);
    507         }
    508        
    509         char *query_detStackedImfile = "UPDATE detStackedImfile SET data_state = '%s'"
    510           " WHERE det_id = %" PRId64
    511           " AND iteration = %" PRId32;
    512         if (!p_psDBRunQueryF(config->dbh, query_detStackedImfile,data_state,det_id,iteration)) {
    513           psError(PS_ERR_UNKNOWN, false,
    514                   "failed to change state for detStackedImfile det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
    515           return(false);
    516         }
     445           //      || (!strcmp(data_state,"full"))
     446           //      || (!strcmp(data_state,"cleaned"))
     447           ))   {
     448        char *query_detProcessedImfile = "UPDATE detProcessedImfile SET data_state = '%s'"
     449          " WHERE det_id = %" PRId64;
     450        if (!p_psDBRunQueryF(config->dbh, query_detProcessedImfile,data_state,det_id)) {
     451          psError(PS_ERR_UNKNOWN, false,
     452                  "failed to change state for detProcessedImfile det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
     453          return(false);
     454        }
     455
     456        char *query_detProcessedExp = "UPDATE detProcessedExp SET data_state = '%s'"
     457          " WHERE det_id = %" PRId64;
     458        if (!p_psDBRunQueryF(config->dbh, query_detProcessedExp,data_state,det_id)) {
     459          psError(PS_ERR_UNKNOWN, false,
     460                  "failed to change state for detProcessedExp det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
     461          return(false);
     462        }
     463
     464        char *query_detNormalizedImfile = "UPDATE detNormalizedImfile SET data_state = '%s'"
     465          " WHERE det_id = %" PRId64
     466          " AND iteration = %" PRId32;
     467        if (!p_psDBRunQueryF(config->dbh, query_detNormalizedImfile,data_state,det_id,iteration)) {
     468          psError(PS_ERR_UNKNOWN, false,
     469                  "failed to change state for detNormalizedImfile det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
     470          return(false);
     471        }
     472
     473        char *query_detNormalizedStatImfile = "UPDATE detNormalizedStatImfile SET data_state = '%s'"
     474          " WHERE det_id = %" PRId64
     475          " AND iteration = %" PRId32;
     476        if (!p_psDBRunQueryF(config->dbh, query_detNormalizedStatImfile,data_state,det_id,iteration)) {
     477          psError(PS_ERR_UNKNOWN, false,
     478                  "failed to change state for detNormalizedStatImfile det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
     479          return(false);
     480        }
     481
     482        char *query_detNormalizedExp = "UPDATE detNormalizedExp SET data_state = '%s'"
     483          " WHERE det_id = %" PRId64
     484          " AND iteration = %" PRId32;
     485        if (!p_psDBRunQueryF(config->dbh, query_detNormalizedExp,data_state,det_id,iteration)) {
     486          psError(PS_ERR_UNKNOWN, false,
     487                  "failed to change state for detNormalizedExp det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
     488          return(false);
     489        }
     490
     491        char *query_detResidImfile = "UPDATE detResidImfile SET data_state = '%s'"
     492          " WHERE det_id = %" PRId64
     493          " AND iteration = %" PRId32;
     494        if (!p_psDBRunQueryF(config->dbh, query_detResidImfile,data_state,det_id,iteration)) {
     495          psError(PS_ERR_UNKNOWN, false,
     496                  "failed to change state for detResidImfile det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
     497          return(false);
     498        }
     499
     500        char *query_detResidExp = "UPDATE detResidExp SET data_state = '%s'"
     501          " WHERE det_id = %" PRId64
     502          " AND iteration = %" PRId32;
     503        if (!p_psDBRunQueryF(config->dbh, query_detResidExp,data_state,det_id,iteration)) {
     504          psError(PS_ERR_UNKNOWN, false,
     505                  "failed to change state for detResidExp det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
     506          return(false);
     507        }
     508
     509        char *query_detStackedImfile = "UPDATE detStackedImfile SET data_state = '%s'"
     510          " WHERE det_id = %" PRId64
     511          " AND iteration = %" PRId32;
     512        if (!p_psDBRunQueryF(config->dbh, query_detStackedImfile,data_state,det_id,iteration)) {
     513          psError(PS_ERR_UNKNOWN, false,
     514                  "failed to change state for detStackedImfile det_id %" PRId64 ", iteration %" PRId32, det_id,iteration);
     515          return(false);
     516        }
    517517      }
    518518      /* End if */
    519      
     519
    520520    }
    521521
Note: See TracChangeset for help on using the changeset viewer.