adding db reorganize() to keep the size down

This commit is contained in:
Vincent Batts 2013-06-18 00:39:09 -04:00
parent 1cecbe0c08
commit d8d4e8ba0a
1 changed files with 5 additions and 2 deletions

View File

@ -67,11 +67,14 @@ exit(0) if options[:migrate]
bh = Persistent::Shell::BinaryHistoryStore.new(bh_options)
# load the new bash_history into the database
bh.load() unless (options[:inspect] or options[:find] or options[:list])
unless (options[:inspect] or options[:find] or options[:list])
bh.load()
bh.db.reorganize()
end
if options[:inspect]
p bh
p "storing #{bh.keys.count} commands"
#p "storing #{bh.keys.count} commands"
end
if options[:find]
bh.find(options[:find]).sort_by {|x| x[:time] }.each do |val|