Skip to content

ClaimExpired

Bases: Exception

Raised by AlchemicalTaskQueue's release()/discard()/extend() when the entry_id/claim_token pair they were given no longer matches a live claim: it already timed out and was reclaimed by someone else, or was already responded to, released, or discarded. Whatever you were about to do with this claim, don't trust it -- someone else may already have, or may still.

Source code in src/alchemical_queues/main.py
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
class ClaimExpired(Exception):
    """Raised by AlchemicalTaskQueue's release()/discard()/extend() when the
    entry_id/claim_token pair they were given no longer matches a live
    claim: it already timed out and was reclaimed by someone else, or was
    already responded to, released, or discarded. Whatever you were about
    to do with this claim, don't trust it -- someone else may already have,
    or may still.
    """

    def __init__(self, entry_id: int):
        super().__init__(
            f"entry_id={entry_id} is not currently claimed under the given claim_token "
            "(it may have timed out and been reclaimed, or already been responded to, "
            "released, or discarded)"
        )
        self.entry_id = entry_id