@@ -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) {
6969dbLoader . 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