lib/ayadn/databases.rb in ayadn-1.0.12 vs lib/ayadn/databases.rb in ayadn-1.0.13
- old
+ new
@@ -14,9 +14,11 @@
@aliases = Daybreak::DB.new "#{Settings.config[:paths][:db]}/aliases.db"
@blacklist = Daybreak::DB.new "#{Settings.config[:paths][:db]}/blacklist.db"
end
def self.close_all
+ @pagination.compact if (File.size("#{Settings.config[:paths][:pagination]}/pagination.db") > (250000))
+ @index.compact if (File.size("#{Settings.config[:paths][:pagination]}/index.db") > (250000))
[@users, @index, @pagination, @aliases, @blacklist].each do |db|
db.flush
db.close
end
end