Browse Source

Save initial profile store

storagebugfix
Sarah Jamie Lewis 1 year ago
parent
commit
ffa2144b9f
2 changed files with 3 additions and 2 deletions
  1. +3
    -0
      storage/profile_store.go
  2. +0
    -2
      storage/profile_store_test.go

+ 3
- 0
storage/profile_store.go 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)


+ 0
- 2
storage/profile_store_test.go 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)



Loading…
Cancel
Save