The msgFlagger function makes multiple calls to the AWS parameter store to retrieve the same information.
The first call during func getAdminChannel(string) (string, error):
|
ar, err := secrets.GetTeamTokens(&db, t) |
|
if err != nil { |
|
return adminChan, errors.Wrap(err, "unable to fetch team tokens") |
|
} |
The second call during func getUserName(string, string) (string, error):
|
ar, err := secrets.GetTeamTokens(&db, t) |
|
if err != nil { |
|
return userName, errors.Wrap(err, "unable to fetch team tokens") |
|
} |
As both of these are remote calls they incur unnecessary cost. An optimisation could be to make a single call and then pass the required values as parameters to these functions.
The
msgFlaggerfunction makes multiple calls to the AWS parameter store to retrieve the same information.The first call during
func getAdminChannel(string) (string, error):bbot/cmd/msgFlagger/main.go
Lines 219 to 222 in a2f193b
The second call during
func getUserName(string, string) (string, error):bbot/cmd/msgFlagger/main.go
Lines 247 to 250 in a2f193b
As both of these are remote calls they incur unnecessary cost. An optimisation could be to make a single call and then pass the required values as parameters to these functions.