Skip to content

Commit

Permalink
https://github.com/water-fountains/datablue/issues/41
Browse files Browse the repository at this point in the history
and reduce debug logging
  • Loading branch information
Ralf Hauser committed Jan 26, 2020
1 parent de1d253 commit 8cebc23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion server/api/services/conflate.data.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,10 @@ function mergeFountainProperties(fountains, mergeNotes='', mergeDistance=null, d
if (null != valueE) {
const vE = cfg.value_translation_extra(valueE);
v.push(...vE);
l.info(`conflate.data.service.js: got additional category for "${p.id}" from "${src_name}": `+new Date().toISOString());
if (debugAll) {
l.info(`conflate.data.service.js: got additional category for "${p.id}" from "${src_name}": `
+new Date().toISOString());
}
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions server/api/services/wikimedia.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class WikimediaService {
l.info('wikimedia.service.js addToImgList foFeaImg: unknown src "'+imgListWithSource.src+'" "'+imgNam+'" ' +dbg + ' '+new Date().toISOString());
}
};
if (0 < duplicateCount //&& debugAll
if (0 < duplicateCount && debugAll
) {
l.info('wikimedia.service.js addToImgList foFeaImg: '+duplicateCount+' duplicates found among ' +imgListWithSource.imgs.length + ' - ' +dbg + ' '+new Date().toISOString());
}
Expand Down Expand Up @@ -190,7 +190,10 @@ class WikimediaService {
}else{
let catNames = fProps.wiki_commons_name.value;
if (1 < catNames.length) {
l.info('wikimedia.service.js: '+catNames.length+' commons categories defined "'+dbg+' '+city+' '+dbgIdWd+' "'+name+'" '+new Date().toISOString());
if (debugAll || 2 < catNames.length) {
l.info('wikimedia.service.js: '+catNames.length+' commons categories defined "'+dbg+' '
+city+' '+dbgIdWd+' "'+name+'" '+new Date().toISOString());
}
}
let catName = 'unkCatNam';
for(let i = 0;i < catNames.length; i++) {
Expand All @@ -216,7 +219,7 @@ class WikimediaService {
let galValPromises = [];
let k = 0;
const imgL = imgUrls.length;
const maxImgPreFetched = 4;
const maxImgPreFetched = 0; //as long as we don't filter for pre-fetched info, why prefetch ? https://github.com/water-fountains/datablue/issues/41
for(;k < maxImgPreFetched && k < imgL;k++) { //only 5 imgs are on the gallery-preview
const img = imgUrls[k];
const imgFromMap = allMap.get(img.src+'_'+img.val);
Expand Down Expand Up @@ -282,7 +285,8 @@ class WikimediaService {
} else {
//could check the qualifiers as per https://github.com/water-fountains/proximap/issues/294
if (debugAll) {
l.info("wikimedia.service.js: fillGallery "+dbgIdWd+" has no img "+city+ ' '+new Date().toISOString());
l.info("wikimedia.service.js: fillGallery "+dbgIdWd+" has no img "+city+
' '+dbg+' '+new Date().toISOString());
}
resolve(fountain);
}
Expand Down

0 comments on commit 8cebc23

Please sign in to comment.