Loglines: did not close databases on #close. fixed -> No segv anymore :)

This commit is contained in:
Denis Knauf 2010-03-29 19:54:29 +02:00
parent 928d89f6b3
commit 877e350d64
2 changed files with 2 additions and 5 deletions

View file

@ -2,6 +2,7 @@
require 'sbdb' require 'sbdb'
require 'safebox' require 'safebox'
require 'robustserver' require 'robustserver'
require 'socket'
require 'logan/inc' require 'logan/inc'
require 'logan/loglines' require 'logan/loglines'
require 'logan/cache' require 'logan/cache'
@ -45,6 +46,7 @@ module LogAn::Inc
@conf[:inc] = {} @conf[:inc] = {}
%w[hosts files fileparser].each {|key| @conf[:inc][key.to_sym] = config( @etc, key) } %w[hosts files fileparser].each {|key| @conf[:inc][key.to_sym] = config( @etc, key) }
@store = LogAn::Cache.new LogAn::AutoValueConvertHash.new( @etc[ 'sids.store', 'seeks', SBDB::Recno, SBDB::CREATE | SBDB::AUTO_COMMIT]), 3 @store = LogAn::Cache.new LogAn::AutoValueConvertHash.new( @etc[ 'sids.store', 'seeks', SBDB::Recno, SBDB::CREATE | SBDB::AUTO_COMMIT]), 3
exit 1
# Prepare Inc-server - create server # Prepare Inc-server - create server
LogAn::Inc::FileParser::Base.logdb = @logs LogAn::Inc::FileParser::Base.logdb = @logs
LogAn::Inc::FileParser::Base.store = @store LogAn::Inc::FileParser::Base.store = @store

View file

@ -72,11 +72,6 @@ module LogAn
@rdb.sync @rdb.sync
end end
def close
@dbs.each {|name, db| db.close 0 }
@rdb.close 0
end
def put val, sid = nil def put val, sid = nil
id = UUIDTools::UUID.timestamp_create id = UUIDTools::UUID.timestamp_create
dat = [sid || 0x10, val].pack 'Na*' dat = [sid || 0x10, val].pack 'Na*'