Closed Bug 1093341 Opened 8 years ago Closed 8 years ago

gengo account balance warning logic runs multiple times per translation sync


(Input Graveyard :: Backend, defect)

Not set


(Not tracked)



(Reporter: willkg, Assigned: willkg)


(Whiteboard: u=dev c=codequality p=2 s=input.2015q1)

Back when I added the code to warn us that the Gengo account balance was getting low, I added it to the balance_good_to_continue code figuring that was where we were checking for errors, too. However, that code kicks off multiple times per translation sync. Because it kicks off multiple times, we're essentially getting one email per thing to be translated. Ew.

Further, we really only want one warning email.

This bug covers removing that code from balance_good_to_continue and putting it in a management command which runs via cron once a day.

That way we get one email per day during the "warning" period and then one email per hour during the "error" period.
This PR reduces the number of emails to one-per-sync:

We should further reduce it to one-per-day, but I want to push that work off until later.
Assignee: nobody → willkg
PR landed in master in

I just pushed that to production just now.

Keeping this open for the better fix. The thing that's holding it up is figuring out how best to add to the generalized translations API a mechanism for running some code once-per-day.
Bumping this to 2015q1 because we're out of time for this quarter.
Whiteboard: u=dev c=codequality p= s=input.2014q4 → u=dev c=codequality p= s=input.2015q1
Pushed this to prod. We're about to hit a warning period, so I should be able to verify it's working then. I'll reopen if it isn't.
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: u=dev c=codequality p= s=input.2015q1 → u=dev c=codequality p=2 s=input.2015q1
Product: Input → Input Graveyard
You need to log in before you can comment on or make changes to this bug.