Finalize statements and vacuum when complete.
This commit is contained in:
+14
-4
@@ -94,9 +94,12 @@ function changeTileID(start, done) {
|
|||||||
}
|
}
|
||||||
db.run('COMMIT', function(err) {
|
db.run('COMMIT', function(err) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
changedTiles += rows.length;
|
st1.finalize(function(err) {
|
||||||
console.warn('Updated %d tiles.', changedTiles);
|
st2.finalize(function(err) {
|
||||||
done();
|
changedTiles += rows.length;
|
||||||
|
console.warn('Updated %d tiles.', changedTiles);
|
||||||
|
done();
|
||||||
|
})});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -125,5 +128,12 @@ function changeGridID(start, done) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function deleteTempKey() {
|
function deleteTempKey() {
|
||||||
db.run('DROP INDEX "temp_tile_id_idx"');
|
db.run('DROP INDEX "temp_tile_id_idx"', function(err) {
|
||||||
|
if (err) throw err;
|
||||||
|
console.warn('Vacuuming...');
|
||||||
|
db.run('VACUUM;', function(err) {
|
||||||
|
if (err) throw err;
|
||||||
|
db.close();
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user