I'm using GAE's 'deffered' library (python), which automatically retries the task in the event an exception is raised.
Is there a way to know (within the task handler function) the number of times the task has been tried?
My end goal is to implement something like:
if num_tries >5:
email_admins()
raise deferred.PermanentTaskFailure
Initially I thought I could use 'TaskRetryOptions' to limit the number of tries, but I believe that doesnt provide a mechanism for my email_admins() call. Or does it?
[edit] of course I could read/write the number of tries to the DB or memcache, but I'd prefer to avoid that complexity. I'd prefer to get the details from the task / task queue if possible.