Skip to content

Commit

Permalink
Fix race in mail, update vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-sommer committed Mar 8, 2018
1 parent eb63fbd commit 0559bbb
Show file tree
Hide file tree
Showing 30 changed files with 1,298 additions and 530 deletions.
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions mail/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ func NewModelList(m *model.Manager, key string) (*modelList, error) {
}

func (m *modelList) Add(rec Recipient) error {
m.mutex.RLock()
m.mutex.Lock()
defer m.mutex.Unlock()
_, ok := m.subscribers[rec.Email]
m.mutex.RUnlock()
if ok {
return nil
}
Expand All @@ -61,9 +61,7 @@ func (m *modelList) Add(rec Recipient) error {
if err != nil {
return err
}
m.mutex.Lock()
m.subscribers[rec.Email] = struct{}{}
m.mutex.Unlock()
return nil
}

Expand Down
29 changes: 29 additions & 0 deletions vendor/github.com/motki/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

117 changes: 46 additions & 71 deletions vendor/github.com/motki/core/eveapi/structure.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions vendor/github.com/motki/core/evedb/universe.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions vendor/github.com/motki/core/model/asset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/motki/core/model/blueprint.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0559bbb

Please sign in to comment.