开发者

How to cancel tasks in a Google App Engine task queue from within your code

开发者 https://www.devze.com 2023-01-10 15:12 出处:网络
I\'m working on a GAE app that will take a comma separated list and create a batch job out of it. I want to add one task to the t开发者_运维技巧ask queue from any one batch job at a given time. The pr

I'm working on a GAE app that will take a comma separated list and create a batch job out of it. I want to add one task to the t开发者_运维技巧ask queue from any one batch job at a given time. The problem with this is that if a task can't be executed it will just keep repeating for ever and the rest of the tasks will never get added to the queue. Is there any way from within my code I can kill a task in the task queue if it's execute too many times?


There's a http header for tasks called "X-AppEngine-TaskRetryCount" that tells you the retry count. If its over a certain threshold then simply exit the task.

0

精彩评论

暂无评论...
验证码 换一张
取 消