@@ -65,10 +65,11 @@ def __init__(self, config, usethreads=False, writeback=False):
65
65
for k in DatastoreMembase .SLAB_CONFIGURATION_KEYS :
66
66
slabconfig [k ] = config .get (C .DATASTORE , k )
67
67
slabconfig [C .CONFIGURATION_SCHEMA_VERSION ] = C .CFGVERSION
68
- self .store_element ( C . DATASTORE_CONFIG , C . CFGSLAB , slabconfig )
68
+ self .slabconfig = slabconfig
69
69
else :
70
70
# Read slab configuration information from the data store.
71
- slabconfig = self .retrieve_element (C .DATASTORE_CONFIG , C .CFGSLAB )
71
+ self .slabconfig = slabconfig = \
72
+ self .retrieve_element (C .DATASTORE_CONFIG , C .CFGSLAB )
72
73
if slabconfig is not None :
73
74
schema_version = slabconfig .get (C .CONFIGURATION_SCHEMA_VERSION )
74
75
if schema_version != C .CFGVERSION :
@@ -166,7 +167,11 @@ def store_slab(self, namespace, slabkey, slabelems):
166
167
167
168
def initialize (self ):
168
169
"Initialize the database."
170
+ # Flush all existing elements.
169
171
self .conndb [threading .currentThread ().name ].flush_all ()
170
172
173
+ # Save the current slab configuration.
174
+ self .store_element (C .DATASTORE_CONFIG , C .CFGSLAB , self .slabconfig )
175
+
171
176
172
177
Datastore = DatastoreMembase
0 commit comments