Another bug found by @yhahn that lead to comitting too often

This commit is contained in:
Konstantin Käfer
2011-07-26 15:44:39 +02:00
parent 235d21939a
commit e60dd402a6

View File

@@ -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);
};