Skip to content

Commit

Permalink
[s3inbox] fix helthcheck url
Browse files Browse the repository at this point in the history
  • Loading branch information
jbygdell committed Sep 18, 2023
1 parent 2fa20b0 commit 4344b5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions sda/cmd/s3inbox/healthchecks.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import (
"strconv"
"time"

"github.com/neicnordic/sensitive-data-archive/internal/config"

"github.com/heptiolabs/healthcheck"
"github.com/neicnordic/sensitive-data-archive/internal/config"
)

// HealthCheck registers and endpoint for healthchecking the service
Expand All @@ -26,8 +25,11 @@ type HealthCheck struct {
// the backend S3 storage and the Message Broker so it can report readiness.
func NewHealthCheck(port int, db *sql.DB, conf *config.Config, tlsConfig *tls.Config) *HealthCheck {
s3URL := conf.Inbox.S3.URL
if conf.Inbox.S3.Port != 0 {
s3URL = fmt.Sprintf("%s:%d", s3URL, conf.Inbox.S3.Port)
}
if conf.Inbox.S3.Readypath != "" {
s3URL = conf.Inbox.S3.URL + conf.Inbox.S3.Readypath
s3URL += conf.Inbox.S3.Readypath
}

brokerURL := fmt.Sprintf("%s:%d", conf.Broker.Host, conf.Broker.Port)
Expand Down
1 change: 0 additions & 1 deletion sda/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,6 @@ func configS3Storage(prefix string) storage.S3Conf {

// Defaults (move to viper?)

s3.Port = 443
s3.Region = "us-east-1"
s3.NonExistRetryTime = 2 * time.Minute

Expand Down

0 comments on commit 4344b5f

Please sign in to comment.