persvr / perstore

CommonJS persistence/object storage based on W3C's object store API.
http://www.persvr.org/
96 stars 20 forks source link

Fixing ordering of Peristent store init #38

Closed kitsonk closed 6 years ago

kitsonk commented 12 years ago

There appears to be an issue when using Persistent store where if you pass a filename in the options, it will call initializeFile(filename) prior to creating the memory store. This is fine when the store does not exist, but when it does exist the store is not then available when store.setIndex() is called in initializeFile().

This pull request resolves that by creating the memory store prior to any point where the initializeFile() is called.