Skip to content

Commit f145f66

Browse files
committed
GPII-3138: Delete and reload snapsets in the data base
Added more log messages.
1 parent 554ae82 commit f145f66

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

scripts/deleteSnapsets.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt
1414
// 3. Deletes the found Prefs Safes and associated GPII Keys
1515
//
1616
// A sample command that runs this script:
17-
// node deleteAndLoadSnapsets.js $COUCHDBURL
17+
// node deleteSnapsets.js $COUCHDBURL
1818

1919
"use strict";
2020

@@ -69,6 +69,7 @@ dbLoader.processSnapsets = function (response) {
6969
dbLoader.addGpiiKeysAndBulkDelete = function (snapSets, docsToRemove) {
7070
fluid.each(snapSets, function (aSnapset) {
7171
var gpiiKeyId = aSnapset.value._id;
72+
fluid.log("Snapset: " + gpiiKeyId);
7273
var gpiiKeyViewUrl = dbLoader.gpiiKeyViewUrl + "?key=%22" + gpiiKeyId + "%22";
7374
var getGpiiKeysRequest = http.request(gpiiKeyViewUrl, function (resp) {
7475
var respString = "";
@@ -83,8 +84,9 @@ dbLoader.addGpiiKeysAndBulkDelete = function (snapSets, docsToRemove) {
8384
// it could call doBatchDelete().
8485
resp.on("end", function () {
8586
var gpiiKeyRecords = JSON.parse(respString);
86-
fluid.each(gpiiKeyRecords.rows, function (record) {
87-
dbLoader.deleteGpiiKey(record.value);
87+
fluid.each(gpiiKeyRecords.rows, function (gpiiKey) {
88+
fluid.log("GPII Key: " + gpiiKey.value._id);
89+
dbLoader.deleteGpiiKey(gpiiKey.value);
8890
});
8991
});
9092
});

0 commit comments

Comments
 (0)