LT-413: Enable analytics on Lesion Tracker

This commit is contained in:
Leonardo Campos committed 2017-02-14 01:25:50 -02:00
1 parent 33f9b8672b
commit b99b986630
11 files changed
+45 -7

No files matched your search

+6 -2
View File
@@ -1,12 +1,16 @@
// 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(() => {
console.warn('Dropping all Collections!');
if (!Meteor.settings.dropCollections) {
return;
}
console.warn('Dropping all global Collections!');
Object.keys(global).forEach((key) => {
const object = global[key];
if (object instanceof Meteor.Collection) {
if (!(/^server|currentServer$/).test(object._name)) {
console.warn(`Dropping: ${object._debugName}`);
console.warn(`Dropping: ${object._debugName || object._name}`);
object.remove({});
}
}