buildgrid.server.actioncache.instance module

Action Cache

Implements an in-memory action Cache

class buildgrid.server.actioncache.instance.ActionCache(cache)

Bases: object

property instance_name
property allow_updates
hash_type()
register_instance_with_server(instance_name, server)

Names and registers the action-cache instance with a given server.

get_action_result(action_digest)

Retrieves the cached result for an Action.

If there is no cached result found, returns None.

Parameters

action_digest (Digest) – The digest of the Action to retrieve the cached result of.

update_action_result(action_digest, action_result)

Stores a result for an Action in the cache.

If the result has a non-zero exit code and cache_failed_actions is False for this cache, the result is not cached.

Parameters
  • action_digest (Digest) – The digest of the Action whose result is being cached.

  • action_result (ActionResult) – The result to cache for the given Action digest.