Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #10 from stripe/praboud-defer-fix
Browse files Browse the repository at this point in the history
Fix bug in cleanup code
  • Loading branch information
praboud committed Apr 13, 2015
2 parents fbd2e28 + cc1c684 commit 7c5012c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sequins.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func (s *sequins) start(address string) error {
// However, this may not be a problem, since you have to shift traffic to
// another instance before shutting down anyway, otherwise you'd have downtime

defer s.indexReference.Replace(nil).Close()
defer func() {
s.indexReference.Replace(nil).Close()
}()

log.Printf("Listening on %s", address)
return http.ListenAndServe(address, s)
Expand Down

0 comments on commit 7c5012c

Please sign in to comment.