Increase the frequency of calling setImmediate in the geocoderDataIterator function
This commit is contained in:
+2
-2
@@ -616,7 +616,7 @@ MBTiles.prototype.putGeocoderData = function(type, shard, data, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var stackCounter = 0;
|
var stackCounter = 0;
|
||||||
var stackMax = 10;
|
var stackMax = 3;
|
||||||
|
|
||||||
// Implements carmen#geocoderDataIterator method.
|
// Implements carmen#geocoderDataIterator method.
|
||||||
MBTiles.prototype.geocoderDataIterator = function(type) {
|
MBTiles.prototype.geocoderDataIterator = function(type) {
|
||||||
@@ -628,7 +628,7 @@ MBTiles.prototype.geocoderDataIterator = function(type) {
|
|||||||
var doneSentinel = {};
|
var doneSentinel = {};
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
// every tenth callback call (globally) do it via setImmediate
|
// every nth callback call (globally) do it via setImmediate
|
||||||
// to avoid callback loops that blow the callstack
|
// to avoid callback loops that blow the callstack
|
||||||
var checkStack = function(cb, arg) {
|
var checkStack = function(cb, arg) {
|
||||||
if (stackCounter >= stackMax) {
|
if (stackCounter >= stackMax) {
|
||||||
|
|||||||
Reference in New Issue
Block a user