Class ApiDeadlineMap
In App Engine, requests are treated as either 'online' or 'offline', with different request time limits and API call deadline limits applied to each.
An online request is a standard HTTP request from an end-user and must typically complete within 60 seconds.
An offline request is one that is not directly serving an incoming, user-initiated HTTP request and is allowed to run for a longer duration (e.g., 10 minutes or more). This typically includes background tasks such as:
- Task Queue tasks (from push or pull queues)
- Cron jobs
Because background tasks often perform long-running operations like data processing or batch
updates, they require longer deadlines. This class provides separate deadline maps for API calls
made during online vs. offline requests. For example, API calls like URL Fetch (urlfetch)
or Cloud SQL (rdbms) have a much higher maximum deadline (e.g., 600 seconds) in the
offline maps, allowing background tasks to complete long-running API calls without timing out.
-
Field Summary
FieldsModifier and TypeFieldDescriptionMap of package name to default API call deadline in seconds for online requests.Map of package name to maximum API call deadline in seconds for online requests.Map of package name to default API call deadline in seconds for offline requests.Map of package name to maximum API call deadline in seconds for offline requests. -
Method Summary
-
Field Details
-
DEFAULT_DEADLINE_MAP
Map of package name to default API call deadline in seconds for online requests. -
MAX_DEADLINE_MAP
Map of package name to maximum API call deadline in seconds for online requests. -
OFFLINE_DEFAULT_DEADLINE_MAP
public static final com.google.common.collect.ImmutableMap<String,Double> OFFLINE_DEFAULT_DEADLINE_MAPMap of package name to default API call deadline in seconds for offline requests. -
OFFLINE_MAX_DEADLINE_MAP
Map of package name to maximum API call deadline in seconds for offline requests.
-