:py:mod:`EVECelery.tasks.BaseTasks.TaskESI` =========================================== .. py:module:: EVECelery.tasks.BaseTasks.TaskESI Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: EVECelery.tasks.BaseTasks.TaskESI.TaskESI .. py:class:: TaskESI Bases: :py:obj:`EVECelery.tasks.BaseTasks.TaskCached.TaskCached` A task utilizing Redis for some form of caching and locks where the results are cached. .. py:property:: queue_assignment :type: 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. .. py:attribute:: autoretry_for :value: () .. py:attribute:: max_retries :value: 3 .. py:attribute:: retry_backoff :value: 5 .. py:attribute:: retry_backoff_max :value: 60 .. py:attribute:: retry_jitter :value: True .. py:attribute:: soft_time_limit :value: 30 .. py:method:: 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() .. py:method:: default_ttl() -> int Default TTL to set in Redis for results that don't have expiry information. :return: The number of seconds to cache a response .. py:method:: base_url() -> str Base URL for ESI requests :return: ESI base request URL :rtype: str .. py:method:: route(**kwargs) -> str :abstractmethod: ESI route with input request parameters :param kwargs: ESI request parameters to fill in the ESI request string :return: ESI route with request parameters :rtype: str .. py:method:: request_url(**kwargs) -> str ESI request URL with request parameters :param kwargs: ESI request parameters to fill in the ESI request string :return: ESI request URL with request parameters :rtype: str .. py:method:: _run_get_result(**kwargs) -> Union[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. :param redis: The redis client :param kwargs: ESI request parameters :return: 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. :rtype: dict or list :raises EVECelery.exceptions.utils.ErrorLimitExceeded: If the remaining error limit is below the allowed threshold.