tweaks, improvements, and minor fixes to limits infrastructure as a result of share limit testing (#276)

This commit is contained in:
Michael Quigley
2023-03-28 14:39:42 -04:00
committed by Kenneth Bingham
parent 49e936caf7
commit 32a53df58c
4 changed files with 22 additions and 16 deletions

View File

@ -27,13 +27,15 @@ func (a *shareWarningAction) HandleShare(shr *store.Share, rxBytes, txBytes int6
return err
}
acct, err := a.str.GetAccount(env.Id, trx)
if err != nil {
return err
}
if env.AccountId != nil {
acct, err := a.str.GetAccount(*env.AccountId, trx)
if err != nil {
return err
}
if err := sendLimitWarningEmail(a.cfg, acct.Email, limit, rxBytes, txBytes); err != nil {
return errors.Wrapf(err, "error sending limit warning email to '%v'", acct.Email)
if err := sendLimitWarningEmail(a.cfg, acct.Email, limit, rxBytes, txBytes); err != nil {
return errors.Wrapf(err, "error sending limit warning email to '%v'", acct.Email)
}
}
return nil