Skip to content

Commit

Permalink
fix: handle nil instances opts
Browse files Browse the repository at this point in the history
  • Loading branch information
23doors committed Jun 16, 2020
1 parent 61924c0 commit 47253b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func NewDB(opts, instancesOpts *pg.Options, logger *log.Logger, debug bool) *DB
commonDB := initDB(opts, logger, debug)
tenantDB := commonDB

if instancesOpts.Addr != opts.Addr || instancesOpts.Database != opts.Database {
if instancesOpts != nil && instancesOpts.Addr != opts.Addr || instancesOpts.Database != opts.Database {
tenantDB = initDB(instancesOpts, logger, debug)
}

Expand Down
4 changes: 1 addition & 3 deletions echo_middleware/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import (
"github.com/Syncano/pkg-go/util"
)

const (
ContextRequestID = "req_id"
)
const ContextRequestID = "req_id"

func logg(c echo.Context, start time.Time, path string, l *zap.Logger, err error) {
res := c.Response()
Expand Down

0 comments on commit 47253b4

Please sign in to comment.