get_tracker_by_url_config#

get_tracker_by_url_config(task_type, url=None, api_key=None)[source]#

Resolve tracker by its configuration URL.

Reads TOP_TRACKER_URL and TOP_MAX_COMPLETED_TASKS environment variables.

Currently only redis:// supported.

Because this code is run during Python module import, we will detect conditions based on environment variables like READTHEDOCS to allow us to shortcut the logic and not try to create tracker connection during docs build.

Parameters:
  • url (Optional[str]) – The URL that defines connection to the tracker backend. If not given use TOP_TRACKER_URL env.

  • task_type (Type[Task]) – Subclass of Task or Task class itself. Used to serialise/deserialise data to Redis.

  • api_key (Optional[str]) – API key for REST web server integration. If not given read from TOP_WEB_API_KEY environment variable.

Returns:

A new task Tracker, unless we are under a special build environment.

Return type:

Optional[Tracker]