Skip to content

Commit c53b75b

Browse files
authored
Update delete_empty_collections.js
1 parent 1c44559 commit c53b75b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bin/scripts/expire-data/delete_empty_collections.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ Promise.all([plugins.dbConnection("countly"), plugins.dbConnection("countly_dril
1616
database.collection(collection).drop(function(err, delOK) {
1717
if (err) {
1818
console.log("Error dropping collection: " + collection, err);
19-
} else if (delOK) {
19+
}
20+
else if (delOK) {
2021
console.log("Collection dropped: " + collection);
21-
} else {
22+
}
23+
else {
2224
console.log("Failed to drop collection: " + collection);
2325
}
2426
});
2527
}
26-
} else {
28+
}
29+
else {
2730
console.log("Collection not found: " + collection);
2831
}
2932
});
@@ -34,7 +37,8 @@ Promise.all([plugins.dbConnection("countly"), plugins.dbConnection("countly_dril
3437
drill.listCollections().toArray(function(err, collections) {
3538
if (err) {
3639
console.log("Error fetching collections:", err);
37-
} else {
40+
}
41+
else {
3842
collections.forEach(function(collection) {
3943
drill.collection(collection.name).countDocuments({}, function(err, count) {
4044
if (!err && count === 0) {

0 commit comments

Comments
 (0)