1
0
Fork 0
mirror of https://github.com/vbatts/persistent-shell-history.git synced 2024-12-26 14:46:32 +00:00

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

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|