Skip to content

Commit

Permalink
User suffix is unused in NATS code, remove
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmcorvidae committed Jul 30, 2024
1 parent 2089d6c commit 31d2f12
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 31d2f12

Please sign in to comment.