Skip to content

Commit

Permalink
cleanup: dont log shutdown errors
Browse files Browse the repository at this point in the history
Signed-off-by: Sander Pick <[email protected]>
  • Loading branch information
sanderpick committed Nov 21, 2019
1 parent 2a3b52c commit 77d6dd0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ func NewServer(ctx context.Context, ts tserv.Threadservice, conf Config) (*Serve
go func() {
for err := range errc {
if err != nil {
log.Errorf("proxy error: %s", err)
if err == http.ErrServerClosed {
break
} else {
log.Errorf("proxy error: %s", err)
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions eventstore/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ func NewManager(ts threadservice.Threadservice, opts ...StoreOption) (*Manager,

for res := range q.Next() {
idStr := ds.RawKey(res.Key).Parent().Parent().Parent().Parent().Name() // reaching for the stars here
if idStr == "" {
continue
}
id, err := uuid.Parse(idStr)
if err != nil {
return nil, err
Expand Down
2 changes: 2 additions & 0 deletions eventstore/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ func TestManager_GetStore(t *testing.T) {
err = model.Create(newPerson)
checkErr(t, err)
assertPersonInModel(t, model, newPerson)
err = store.Start()
checkErr(t, err)

// Close it down, restart next
err = man.Close()
Expand Down
1 change: 0 additions & 1 deletion service.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ func (s *service) subscribe(id thread.ID) {
for {
msg, err := sub.Next(s.threads.ctx)
if err != nil {
log.Error(err)
break
}

Expand Down
3 changes: 2 additions & 1 deletion threads.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ func NewThreads(
go func() {
for err := range errc {
if err != nil {
log.Errorf("proxy error: %s", err)
if err == http.ErrServerClosed {
break
} else {
log.Errorf("proxy error: %s", err)
}
}
}
Expand Down

0 comments on commit 77d6dd0

Please sign in to comment.