Save initial profile store

This commit is contained in:
Sarah Jamie Lewis 2019-02-04 11:17:33 -08:00
parent ef2b95c54b
commit ffa2144b9f
2 changed files with 3 additions and 2 deletions

View File

@ -36,6 +36,9 @@ func NewProfileStore(eventManager *event.Manager, directory, password string, pr
os.Mkdir(directory, 0700)
ps := &profileStore{fs: NewFileStore(directory, profileFilename, password), password: password, directory: directory, profile: profile, eventManager: eventManager, streamStores: map[string]StreamStore{}}
ps.queue = event.NewEventQueue(100)
if profile != nil {
ps.save()
}
go ps.eventHandler()
ps.eventManager.Subscribe(event.BlockPeer, ps.queue.EventChannel)

View File

@ -20,8 +20,6 @@ func TestProfileStoreWriteRead(t *testing.T) {
profile := NewProfile(testProfileName)
ps1 := NewProfileStore(eventBus, testingDir, password, profile)
eventBus.Publish(event.NewEvent(event.SetAttribute, map[event.Field]string{event.Key: testKey, event.Data: testVal}))
time.Sleep(1 * time.Second)