Commit f503daf9 authored by Barry Warsaw's avatar Barry Warsaw

env_from_string(): Added config.logdir to specify a different log

directory.
parent 36c9e522
...@@ -39,7 +39,7 @@ from bsddb3 import db ...@@ -39,7 +39,7 @@ from bsddb3 import db
from ZODB import POSException from ZODB import POSException
from ZODB.BaseStorage import BaseStorage from ZODB.BaseStorage import BaseStorage
__version__ = '$Revision: 1.18 $'.split()[-2:][0] __version__ = '$Revision: 1.19 $'.split()[-2:][0]
# Lock usage is inherently unbounded because there may be an unlimited number # Lock usage is inherently unbounded because there may be an unlimited number
# of objects actually touched in any single transaction, and worst case could # of objects actually touched in any single transaction, and worst case could
...@@ -92,11 +92,15 @@ class BerkeleyConfig: ...@@ -92,11 +92,15 @@ class BerkeleyConfig:
- kbytes is passed directly to txn_checkpoint() - kbytes is passed directly to txn_checkpoint()
- min is passed directly to txn_checkpoint() - min is passed directly to txn_checkpoint()
- logdir if not None, is passed to the environment's set_lg_dir() method
before it is opened.
""" """
numlocks = DEFAULT_MAX_LOCKS numlocks = DEFAULT_MAX_LOCKS
interval = 100 interval = 100
kbyte = 0 kbyte = 0
min = 0 min = 0
logdir = None
...@@ -321,6 +325,8 @@ def env_from_string(envname, config): ...@@ -321,6 +325,8 @@ def env_from_string(envname, config):
# already exists # already exists
env = db.DBEnv() env = db.DBEnv()
env.set_lk_max_locks(config.numlocks) env.set_lk_max_locks(config.numlocks)
if config.logdir is not None:
env.set_lg_dir(config.logdir)
env.open(envname, env.open(envname,
db.DB_CREATE # create underlying files as necessary db.DB_CREATE # create underlying files as necessary
| db.DB_RECOVER # run normal recovery before opening | db.DB_RECOVER # run normal recovery before opening
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment