@trigger.dev/redis-worker 4.5.3 → 4.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -17007,6 +17007,20 @@ var MollifierBuffer = class {
17007
17007
  const claimKey = makeIdempotencyClaimKey(input);
17008
17008
  await this.redis.releaseMollifierClaim(claimKey, `${PENDING_PREFIX}${input.token}`);
17009
17009
  }
17010
+ // Reopen a RESOLVED claim slot whose winner was cleared, so the claim-loser
17011
+ // reacquire path can re-serialise a cross-DB recreate through a fresh claim.
17012
+ // Compare-and-delete on the observed `expectedRunId` (never an unconditional
17013
+ // DEL) so a concurrent reacquirer that already re-published a NEW winner is
17014
+ // never wiped. Reuses the lookup self-heal's compare-and-delete Lua. Returns
17015
+ // true if the stale slot was cleared.
17016
+ async resetResolvedClaim(input) {
17017
+ const claimKey = makeIdempotencyClaimKey(input);
17018
+ const deleted = await this.redis.delMollifierKeyIfEquals(
17019
+ claimKey,
17020
+ input.expectedRunId
17021
+ );
17022
+ return deleted === 1;
17023
+ }
17010
17024
  // Read the current claim value, used by the wait/poll loop on losers
17011
17025
  // to detect "pending" → "resolved" transitions and timeouts.
17012
17026
  async readClaim(input) {