SubsUnion debug
This commit is contained in:
parent
ce23ae58e6
commit
0026b498eb
1 changed files with 5 additions and 4 deletions
|
|
@ -10,6 +10,7 @@ import calcUnion from '/imports/ui/components/Maps/SubsUnion/Unify';
|
||||||
// sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev
|
// sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev
|
||||||
|
|
||||||
Meteor.startup(() => {
|
Meteor.startup(() => {
|
||||||
|
const debug = true; // Meteor.isDevelopment;
|
||||||
Perlin.seed(Math.random());
|
Perlin.seed(Math.random());
|
||||||
|
|
||||||
const addNoisy = (osub) => {
|
const addNoisy = (osub) => {
|
||||||
|
|
@ -58,7 +59,7 @@ Meteor.startup(() => {
|
||||||
// https://stackoverflow.com/questions/10827812/what-is-the-length-maximum-for-a-string-data-type-in-mongodb-used-with-ruby
|
// https://stackoverflow.com/questions/10827812/what-is-the-length-maximum-for-a-string-data-type-in-mongodb-used-with-ruby
|
||||||
SiteSettings.upsert({ name: `subs-${publicl}-union` }, unionSet, { multi: false });
|
SiteSettings.upsert({ name: `subs-${publicl}-union` }, unionSet, { multi: false });
|
||||||
SiteSettings.upsert({ name: `subs-${publicl}-union-bounds` }, boundsSet, { multi: false });
|
SiteSettings.upsert({ name: `subs-${publicl}-union-bounds` }, boundsSet, { multi: false });
|
||||||
if (Meteor.isDevelopment) console.log(`${Publicl} subscription union calculated`);
|
if (debug) console.log(`${Publicl} subscription union calculated`);
|
||||||
} else {
|
} else {
|
||||||
console.log('Subscription union failed!');
|
console.log('Subscription union failed!');
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +71,7 @@ Meteor.startup(() => {
|
||||||
|
|
||||||
Subscriptions.find({ createdAt: { $gt: new Date() } }).observe({
|
Subscriptions.find({ createdAt: { $gt: new Date() } }).observe({
|
||||||
added: function newSubAdded() { // doc) {
|
added: function newSubAdded() { // doc) {
|
||||||
if (Meteor.isDevelopment) console.log('Subs added so recreate union');
|
if (debug) console.log('Subs added so recreate union');
|
||||||
process(true);
|
process(true);
|
||||||
process(false);
|
process(false);
|
||||||
}
|
}
|
||||||
|
|
@ -78,12 +79,12 @@ Meteor.startup(() => {
|
||||||
|
|
||||||
Subscriptions.find().observe({
|
Subscriptions.find().observe({
|
||||||
changed: function subsChanged() { // updatedDoc, oldDoc) {
|
changed: function subsChanged() { // updatedDoc, oldDoc) {
|
||||||
if (Meteor.isDevelopment) console.log('Subs changed so recreate union');
|
if (debug) console.log('Subs changed so recreate union');
|
||||||
process(true);
|
process(true);
|
||||||
process(false);
|
process(false);
|
||||||
},
|
},
|
||||||
removed: function subsRemoved() { // oldDoc) {
|
removed: function subsRemoved() { // oldDoc) {
|
||||||
if (Meteor.isDevelopment) console.log('Subs removed so recreate union');
|
if (debug) console.log('Subs removed so recreate union');
|
||||||
process(true);
|
process(true);
|
||||||
process(false);
|
process(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue