From 334735b7f900644c10388e6c45345b62e9ad9c77 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 28 Jan 2011 10:07:44 +0100 Subject: [PATCH] bdb: support running without envs The various checkpointing function may be called when no env has been loaded (yet), support this. --- lib/rbot/registry/bdb.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/rbot/registry/bdb.rb b/lib/rbot/registry/bdb.rb index 5acfe491..4457a369 100644 --- a/lib/rbot/registry/bdb.rb +++ b/lib/rbot/registry/bdb.rb @@ -146,6 +146,10 @@ module Irc end def DBTree.cleanup_logs() + if @@env.nil? + debug "No BDB environment, skipping checkpoint" + return + end begin debug "DBTree: checkpointing ..." @@env.checkpoint @@ -166,6 +170,10 @@ module Irc end def DBTree.stats() + if @@env.nil? + debug "No BDB environment, no stats" + return + end begin debug "General stats:" debug @@env.stat @@ -181,6 +189,10 @@ module Irc end def DBTree.cleanup_env() + if @@env.nil? + debug "No BDB environment, skipping cleanup" + return + end begin debug "DBTree: checking transactions ..." has_active_txn = @@env.txn_stat["st_nactive"] > 0 -- 2.39.2