Skip to content

Commit

Permalink
fix: panic on start when BindAddr cannot be resolved #217
Browse files Browse the repository at this point in the history
  • Loading branch information
buraksezer committed Feb 4, 2023
1 parent bf4f87c commit b300297
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions cmd/olricd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ type Olricd struct {

// New creates a new Server instance
func New(c *config.Config) (*Olricd, error) {
db, err := olric.New(c)
if err != nil {
return nil, err
}
return &Olricd{
config: c,
log: c.Logger,
db: db,
}, nil
}

Expand Down Expand Up @@ -83,12 +88,6 @@ func (s *Olricd) Start() error {
// Wait for SIGTERM or SIGINT
go s.waitForInterrupt()

db, err := olric.New(s.config)
if err != nil {
return err
}
s.db = db

s.errGr.Go(func() error {
return s.db.Start()
})
Expand Down
2 changes: 1 addition & 1 deletion olric.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import (
)

// ReleaseVersion is the current stable version of Olric
const ReleaseVersion string = "0.5.3"
const ReleaseVersion string = "0.5.4"

var (
// ErrOperationTimeout is returned when an operation times out.
Expand Down

0 comments on commit b300297

Please sign in to comment.