Skip to content

Template cache policy for failed browser automation #118

Description

@fgregg

it would be good to either add as a default cache policy, or provide as documentation a cache policy that will fail on any failed automations

class ZyteAPIPolicy(DummyPolicy):

    def should_cache_response(self, response, request):
        if not super().should_cache_response(response, request):
            return False

        if any('error' in action for action in response.raw_api_response['actions']):
            return False

        return True

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions