Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
opts, args = parser.parse_args(['copy', '--compact', '-e', envpath, dstdir])
env = lmdb.open(
opts.env,
map_size=map_size,
subdir=True,
max_dbs=opts.max_dbs,
create=False,
readonly='READ'
)
lmdb.tool.ENV = env
tick = time.time()
# use the builtin lmdb command
ret = lmdb.tool.cmd_copy(opts, args[1:])
logger.warning(f'lmdb ret: {ret}')
tock = time.time()
logger.info(f'backup took: {tock-tick:.2f} seconds')
env.close()