Another bug found by @yhahn that lead to comitting too often
This commit is contained in:
@@ -560,7 +560,7 @@ MBTiles.prototype.putTile = function(z, x, y, data, callback) {
|
||||
this._mapCache[coords].tile_id = id;
|
||||
|
||||
// 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);
|
||||
};
|
||||
|
||||
@@ -599,7 +599,7 @@ MBTiles.prototype.putGrid = function(z, x, y, data, callback) {
|
||||
this._mapCache[coords].grid_id = id;
|
||||
|
||||
// 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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user