Take the 2-minute tour ×

Is there a way to dynamically determine whether the currently executing task is a standard http request or a TaskQueue?

In some parts of my request handler, I make a few urlfetches. I would like the timeout delay of the url fetch to be short if the request is a standard http request and long if it is a TaskQueue.

share|improve this question
Interesting. I suppose I would wrap the code that creates a TaskQueue request to add an additional boolean to kwargs. Could be messy. –  robert king Jun 18 '12 at 11:27

2 Answers 2

up vote 6 down vote accepted

Pick any one of the following HTTP headers:

  1. X-AppEngine-QueueName, the name of the queue (possibly default)
  4. X-AppEngine-TaskETA, the target execution time of the task, specified in microseconds since January 1st 1970.

Standard HTTP requests won't have these headers.

share|improve this answer

Task requests always include a specific set of HTTP headers, which you can check.

share|improve this answer
Same thing for the cron jobs.. X-AppEngine-Cron: true developers.google.com/appengine/docs/python/config/… –  Lipis Jun 18 '12 at 12:02

Your Answer


