Skip to content

Commit

Permalink
Merge pull request #17 from ianmcorvidae/user-suffix
Browse files Browse the repository at this point in the history
User suffix is unused in NATS code, remove
  • Loading branch information
ianmcorvidae authored Jul 31, 2024
2 parents 2089d6c + 31d2f12 commit 073af42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func main() {
log.Fatal(errors.Wrap(err, "Can't parse database.uri in the config file"))
}

userSuffix := config.String("users.domain")
userSuffix := strings.Trim(config.String("users.domain"), "@")
if userSuffix == "" {
log.Fatal("users.domain must be set in the configuration file")
}
Expand Down Expand Up @@ -139,7 +139,7 @@ func main() {
log.Infof("NATS queue is %s", *natsQueue)
log.Infof("--report-overages is %t", *reportOverages)

natsClient := natscl.NewClient(natsConn, userSuffix, serviceName)
natsClient := natscl.NewClient(natsConn, serviceName)

a := app.New(natsClient, dbconn, userSuffix)

Expand Down
4 changes: 1 addition & 3 deletions natscl/natscl.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,12 @@ func NewConnection(settings *ConnectionSettings) (*nats.EncodedConn, error) {
type Client struct {
conn *nats.EncodedConn
subscriptions []*nats.Subscription
userSuffix string
queueSuffix string
}

func NewClient(conn *nats.EncodedConn, userSuffix, queueSuffix string) *Client {
func NewClient(conn *nats.EncodedConn, queueSuffix string) *Client {
return &Client{
conn: conn,
userSuffix: userSuffix,
queueSuffix: queueSuffix,
subscriptions: make([]*nats.Subscription, 0),
}
Expand Down

0 comments on commit 073af42

Please sign in to comment.