Closed slinkp closed 12 years ago
Yeah, I probably need to add some documentation about all of this. The backoff logic is from delayed job (this is a rough port of it), but they do at least mention specific values in their docs.
Logging exceptions etc makes sense. I was relying on looking at the database last_error column for this, but no reason why it can't be logged too.
Will add more docs and logging later.
John
Ok have updated docs and added more logging now.
The exponential backoff time seems rather excessive with the default MAX_ATTEMPTS of 25 This line:
backoff = timedelta(seconds=(self.attempts \ 4) + 5)
results in multi-minute rescheduling past the third attempt, and hours past the eighth attempt, ending at several days. For example:
The reschedule deltas aren't logged either, and neither are exceptions, so it's easy to have a trivial mistake such as a NameError in your background function and have it rescheduled for days, and unless you read the django-background-task source and do the math, you won't realize it's doing that; and unless you do your own logging you won't ever learn why it fails.