From e60dd402a6a664afc6baf3335a23326d8f92e569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 26 Jul 2011 15:44:39 +0200 Subject: [PATCH] Another bug found by @yhahn that lead to comitting too often --- lib/mbtiles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mbtiles.js b/lib/mbtiles.js index 66e5fd5..7e7f069 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -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); };