Remove unnecessary dropCollection function. Make it opt-in for Lesion Tracker testing
This commit is contained in:
1 parent
bf97c3ebe2
commit
21054f17ef
2 files changed
+11
-31
No files matched your search
@@ -1,18 +1,16 @@
|
|||||||
// Temporary fix to drop all Collections on server restart
|
// Temporary fix to drop all Collections on server restart
|
||||||
// http://stackoverflow.com/questions/23891631/meteor-how-can-i-drop-all-mongo-collections-and-clear-all-data-on-startup
|
// http://stackoverflow.com/questions/23891631/meteor-how-can-i-drop-all-mongo-collections-and-clear-all-data-on-startup
|
||||||
Meteor.startup(() => {
|
Meteor.startup(() => {
|
||||||
if (!Meteor.settings.dropCollections) {
|
if (Meteor.settings.dropCollections === true) {
|
||||||
return;
|
console.warn('Dropping all global Collections!');
|
||||||
}
|
Object.keys(global).forEach((key) => {
|
||||||
|
const object = global[key];
|
||||||
console.warn('Dropping all global Collections!');
|
if (object instanceof Meteor.Collection) {
|
||||||
Object.keys(global).forEach((key) => {
|
if (!(/^server|currentServer$/).test(object._name)) {
|
||||||
const object = global[key];
|
console.warn(`Dropping: ${object._debugName || object._name}`);
|
||||||
if (object instanceof Meteor.Collection) {
|
object.remove({});
|
||||||
if (!(/^server|currentServer$/).test(object._name)) {
|
}
|
||||||
console.warn(`Dropping: ${object._debugName || object._name}`);
|
|
||||||
object.remove({});
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
@@ -35,21 +35,3 @@ Meteor.publish('singlePatientImageMeasurements', function(patientId) {
|
|||||||
Meteor.publish('reviewers', function() {
|
Meteor.publish('reviewers', function() {
|
||||||
return Reviewers.find();
|
return Reviewers.find();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Temporary fix to drop all Collections on server restart
|
|
||||||
// http://stackoverflow.com/questions/23891631/meteor-how-can-i-drop-all-mongo-collections-and-clear-all-data-on-startup
|
|
||||||
Meteor.startup(function() {
|
|
||||||
if (!Meteor.settings.dropCollections) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var property in global) {
|
|
||||||
var object = global[property];
|
|
||||||
if (object instanceof Meteor.Collection) {
|
|
||||||
if (!(/^server|currentServer$/).test(object._name)) {
|
|
||||||
console.warn(`Dropping: ${object._debugName || object._name}`);
|
|
||||||
object.remove({});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Reference in new issue
Block a user