3 ms·
What if this code is called multiple times in quick succession? Based on the fact that I got a dozen separate emails over the span of 10 minutes, I'm guessing T
by hartleybrody 13y ago
What if this code is called multiple times in quick succession? Based on the fact that I got a dozen separate emails over the span of 10 minutes, I'm guessing Twilio's overcharging happened in a series of transactions, not all at once.
This code -- while good for catching bad single calculations -- wouldn't catch that.
- wizzard 13y agoWell I don't think he was saying "cut and paste this exact code into your codebase" but rather that it is possible to write safeguards such as this... in this case, perhaps checking whether an account has already been billed this month, or whether there is already a transaction pending, or... We can't prevent every mistake but we can make sure the same one doesn't happen again.