summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-01-28 10:07:44 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-01-28 10:07:44 +0100
commit334735b7f900644c10388e6c45345b62e9ad9c77 (patch)
treee0ebfc250cc0694b2f73e8a25c38de5605db35c6 /lib/rbot
parent557a391d9253222ca80bb09c416bbe1eaf3c71a5 (diff)
bdb: support running without envs
The various checkpointing function may be called when no env has been loaded (yet), support this.
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/registry/bdb.rb12
1 files changed, 12 insertions, 0 deletions
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