EVECelery.tasks.BaseTasks.TaskESI#

Module Contents#

Classes#

TaskESI

A task utilizing Redis for some form of caching and locks where the results are cached.

class EVECelery.tasks.BaseTasks.TaskESI.TaskESI#

Bases: EVECelery.tasks.BaseTasks.TaskCached.TaskCached

A task utilizing Redis for some form of caching and locks where the results are cached.

property queue_assignment: str | None#

The queue to register this task with.

Returns the name of the queue to optionally register this task with. If None is provided then this task is registered with the default queue defined by the celery app.

Return type:

str | None

autoretry_for = ()#
max_retries = 3#
retry_backoff = 5#
retry_backoff_max = 60#
retry_jitter = True#
soft_time_limit = 30#
request_method() str#

Returns the type of request made to ESI

This method will return the request method (get, post, etc.) made to ESI. :return: Request method passed to requests.request()

Return type:

str

default_ttl() int#

Default TTL to set in Redis for results that don’t have expiry information.

Returns:

The number of seconds to cache a response

Return type:

int

base_url() str#

Base URL for ESI requests

Returns:

ESI base request URL

Return type:

str

abstract route(**kwargs) str#

ESI route with input request parameters

Parameters:

kwargs – ESI request parameters to fill in the ESI request string

Returns:

ESI route with request parameters

Return type:

str

request_url(**kwargs) str#

ESI request URL with request parameters

Parameters:

kwargs – ESI request parameters to fill in the ESI request string

Returns:

ESI request URL with request parameters

Return type:

str

_run_get_result(**kwargs) EVECelery.tasks.BaseTasks.Models.ModelsCached.ModelCachedSuccess | EVECelery.tasks.BaseTasks.Models.ModelsCached.ModelCachedException#

Gets the ESI cached response. If the response is not yet cached or hasn’t been resolved then perform an ESI call caching the new response.

This function should not be called outside of celery tasks and should only be invoked by the task function handling a lookup queue.

Parameters:
  • redis – The redis client

  • kwargs – ESI request parameters

Returns:

Dictionary containing response from ESI. If ESI returned a 404 error the response will be in the form {“error”: error_message, “error_code”: 404} If the response doesn’t require request inputs then list is usually returned (list factions, prices, etc). If the response requires inputs a dictionary is usually returned. Only /universe/factions/ and /markets/prices/ returns a list, all else return dictionaries.

Return type:

dict or list

Raises:

EVECelery.exceptions.utils.ErrorLimitExceeded – If the remaining error limit is below the allowed threshold.