Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _initCoXact(self):
try:
self.xact = self.lenv.begin(write=not self.readonly)
except lmdb.MapResizedError:
# This is what happens when some *other* process increased the mapsize. setting mapsize to 0 should
# set my mapsize to whatever the other process raised it to
self.lenv.set_mapsize(0)
self.mapsize = self.lenv.info()['map_size']
self.xact = self.lenv.begin(write=not self.readonly)
self.dirty = False