Skip to content

Say in a failed economy answer how long its failure is kept #4171

Closed

Description

@anth-volk

A failed economy calculation's 502 body is {"status": "error", "message": "...", "result": null}. When a new run can be requested is written only in the message, for example "A new run for this state can be requested 2 minutes after this failure." (#4064). A client that wants to know when to offer Retry has to parse that sentence, which PolicyEngine/policyengine-app-v2#1439 does today.

The stored failure already has an expiry in the runtime cache: 2 minutes for a failed US state or local-area breakdown job, and 30 days for every other failure, including US state failures stored before #4064. Until it expires, every request gets the same failure, and the first request after it submits a new job.

The 502 body should carry that remaining time as a number, read from the cache's own expiry, so clients read a field instead of the message text.

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