comparison mod_storage_gdbm/mod_storage_gdbm.lua @ 1756:c619425dafe7

mod_storage_gdbm: Reorganize (vacuum) databases on module unload
author Kim Alvefur <zash@zash.se>
date Tue, 19 May 2015 23:30:39 +0200
parents c04d10557bbc
children e72f9eac51c8
comparison
equal deleted inserted replaced
1755:0a21b16b9075 1756:c619425dafe7
168 end 168 end
169 169
170 function module.unload() 170 function module.unload()
171 for db_path, db in pairs(cache) do 171 for db_path, db in pairs(cache) do
172 module:log("debug", "Closing db at %q", db_path); 172 module:log("debug", "Closing db at %q", db_path);
173 gdbm.reorganize(db);
173 gdbm.sync(db); 174 gdbm.sync(db);
174 gdbm.close(db); 175 gdbm.close(db);
175 end 176 end
176 end 177 end
177 178