Changeset 40137
- Timestamp:
- Sep 14, 2017, 3:14:36 PM (9 years ago)
- Location:
- tags/ipp-20170121/ippTools/src
- Files:
-
- 2 edited
-
pzgetexp.c (modified) (4 diffs)
-
pzgetexpConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20170121/ippTools/src/pzgetexp.c
r31038 r40137 77 77 PXOPT_LOOKUP_S32(timeout, config->args, "-timeout", false, false); 78 78 PXOPT_LOOKUP_BOOL(all, config->args, "-all", false); 79 79 PXOPT_LOOKUP_STR(myLastFileSet, config->args, "-last-fileset", false, false); 80 80 81 // find last fileset/exp_name (if we have one) 81 82 bool haveLastFileSet = false; 82 83 psString lastFileSet = NULL; 83 84 85 // fprintf (stderr, "myLastFileSet %s.. (%d)\n", myLastFileSet, myLastFileSet[0]); 86 // if -last-fileset is not supplied, myLastFileSet is NOT NULL, but myLastFileSet[0] = 0 87 84 88 // -all means "request all known filesets" 85 if (!all ) {86 char *query = "SELECT * from summitExp WHERE camera = \"%s\" and TELESCOPE = \"%s\" ORDER BY dateobs DESC LIMIT 1 ";89 if (!all && !myLastFileSet[0]) { 90 char *query = "SELECT * from summitExp WHERE camera = \"%s\" and TELESCOPE = \"%s\" ORDER BY dateobs DESC LIMIT 10"; 87 91 if (!p_psDBRunQueryF(config->dbh, query, camera, telescope)) { 88 92 psError(PS_ERR_UNKNOWN, false, "database error"); … … 102 106 haveLastFileSet = true; 103 107 bool status = false; 104 lastFileSet = psStringCopy(psMetadataLookupStr(&status, output->data[0], "exp_name")); 108 long Nlast = psArrayLength(output); 109 lastFileSet = psStringCopy(psMetadataLookupStr(&status, output->data[Nlast - 1], "exp_name")); 105 110 psFree(output); 106 111 } 112 } 113 114 if (myLastFileSet && myLastFileSet[0]) { 115 haveLastFileSet = true; 116 lastFileSet = psStringCopy(myLastFileSet); 107 117 } 108 118 … … 121 131 } 122 132 133 // fprintf (stderr, "pzgetexp: cmd is: %s\n", cmd); 123 134 psTrace("pzgetexp", PS_LOG_INFO, "cmd is: %s\n", cmd); 124 135 … … 145 156 return true; 146 157 } 158 159 // fprintf (stderr, "Number of newSummitExps: %d\n", (int) psArrayLength(newSummitExps)); 147 160 148 161 // start a transaction so it's all rows or nothing -
tags/ipp-20170121/ippTools/src/pzgetexpConfig.c
r18919 r40137 45 45 46 46 psMetadata *args = psMetadataAlloc(); 47 psMetadataAddStr(args , PS_LIST_TAIL, "-uri", 0, 48 "DataStore product URI (required)", ""); 49 psMetadataAddStr(args , PS_LIST_TAIL, "-inst", 0, 50 "camera name (required)", ""); 51 psMetadataAddStr(args , PS_LIST_TAIL, "-telescope", 0, 52 "telescope name (required)", ""); 53 psMetadataAddS32(args, PS_LIST_TAIL, "-timeout", 0, 54 "HTTP timeout", 0); 55 psMetadataAddBool(args, PS_LIST_TAIL, "-all", 0, 56 "download ALL filesets", 0); 57 47 psMetadataAddStr(args , PS_LIST_TAIL, "-uri", 0, "DataStore product URI (required)", ""); 48 psMetadataAddStr(args , PS_LIST_TAIL, "-inst", 0, "camera name (required)", ""); 49 psMetadataAddStr(args , PS_LIST_TAIL, "-telescope", 0, "telescope name (required)", ""); 50 psMetadataAddS32(args, PS_LIST_TAIL, "-timeout", 0, "HTTP timeout", 0); 51 psMetadataAddBool(args, PS_LIST_TAIL, "-all", 0, "download ALL filesets", 0); 52 psMetadataAddStr(args , PS_LIST_TAIL, "-last-fileset", 0, "Manually supply the last fileset (alternate starting point)", ""); 58 53 59 54 bool status = false;
Note:
See TracChangeset
for help on using the changeset viewer.
