Closed Bug 1093341 Opened 10 years ago Closed 9 years ago

gengo account balance warning logic runs multiple times per translation sync

Categories

(Input Graveyard :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: willkg)

Details

(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: https://github.com/mozilla/fjord/pull/375

We should further reduce it to one-per-day, but I want to push that work off until later.
Assignee: nobody → willkg
Status: NEW → ASSIGNED
PR landed in master in https://github.com/mozilla/fjord/commit/6669479d14528328db29886876f6bf20dc2bc8e0

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.
Status: ASSIGNED → RESOLVED
Closed: 9 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.