Skip to content

Commit f209178

Browse files
committed
fix delete-run, minor cleanups
1 parent 655ada1 commit f209178

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

queries/cdmq/cdm.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,7 @@ findYearDotMonthFromRun = async function (instance, runId) {
13041304
return matches[1];
13051305
}
13061306
};
1307+
exports.findYearDotMonthFromRun = findYearDotMonthFromRun;
13071308

13081309
findInstanceFromRun = async function (instances, runId) {
13091310
var foundInstance;
@@ -1325,6 +1326,7 @@ findInstanceFromRun = async function (instances, runId) {
13251326
debuglog('findInstanceFromRun(): about to return');
13261327
return foundInstance;
13271328
};
1329+
exports.findInstanceFromRun = findInstanceFromRun;
13281330

13291331
findInstanceFromPeriod = async function (instances, periId) {
13301332
var foundInstance;
@@ -1341,6 +1343,7 @@ findInstanceFromPeriod = async function (instances, periId) {
13411343
}
13421344
return foundInstance;
13431345
};
1346+
exports.findInstanceFromPeriod = findInstanceFromPeriod;
13441347

13451348
mgetParams = async function (instance, iterIds, yearDotMonth) {
13461349
return await mSearch(instance, 'param', yearDotMonth, ['iteration.iteration-uuid'], [iterIds], 'param', null, 1000);

queries/cdmq/delete-run.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async function main() {
6262
// to delete just any copy of this run.
6363
//
6464
// In order to delete, we must first find out which year and date the run comes from
65-
const yearDotMonth = cdm.getYearDotMonth(program.run);
65+
const yearDotMonth = cdm.findYearDotMonthFromRun(instances[instances.length - 1], program.run);
6666
cdm.deleteDocs(instances[instances.length - 1], allDocTypes, q);
6767
var numDocTypes = await cdm.waitForDeletedDocs(instances[instances.length - 1], program.run, allDocTypes);
6868
if (numDocTypes > 0) {

queries/cdmq/get-result-summary.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ async function main() {
8888

8989
getInstancesInfo(instances);
9090
cdm.debuglog(JSON.stringify(instances, null, 2));
91-
console.log(JSON.stringify(instances, null, 2));
9291

9392
// Since this query is looking for run ids (and may not inlcude run-uuid as a search term), we
9493
// need to check all instances.

0 commit comments

Comments
 (0)