Another bug found by @yhahn that lead to comitting too often
This commit is contained in:
+2
-2
@@ -560,7 +560,7 @@ MBTiles.prototype.putTile = function(z, x, y, data, callback) {
|
|||||||
this._mapCache[coords].tile_id = id;
|
this._mapCache[coords].tile_id = id;
|
||||||
|
|
||||||
// Only commit when we can insert at least 100 rows.
|
// Only commit when we can insert at least 100 rows.
|
||||||
if (++this._pending < 100) return this._commit(callback);
|
if (++this._pending >= 100) return this._commit(callback);
|
||||||
else return callback(null);
|
else return callback(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -599,7 +599,7 @@ MBTiles.prototype.putGrid = function(z, x, y, data, callback) {
|
|||||||
this._mapCache[coords].grid_id = id;
|
this._mapCache[coords].grid_id = id;
|
||||||
|
|
||||||
// Only commit when we can insert at least 100 rows.
|
// Only commit when we can insert at least 100 rows.
|
||||||
if (++this._pending < 100) return this._commit(callback);
|
if (++this._pending >= 100) return this._commit(callback);
|
||||||
else return callback(null);
|
else return callback(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user