@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 +14 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2177,9 +2177,9 @@ declare const BufferEntrySchema: z.ZodObject<{
|
|
|
2177
2177
|
payload: string;
|
|
2178
2178
|
createdAt: Date;
|
|
2179
2179
|
runId: string;
|
|
2180
|
+
attempts: number;
|
|
2180
2181
|
envId: string;
|
|
2181
2182
|
orgId: string;
|
|
2182
|
-
attempts: number;
|
|
2183
2183
|
createdAtMicros: number;
|
|
2184
2184
|
materialised: boolean;
|
|
2185
2185
|
idempotencyLookupKey: string;
|
|
@@ -2193,9 +2193,9 @@ declare const BufferEntrySchema: z.ZodObject<{
|
|
|
2193
2193
|
payload: string;
|
|
2194
2194
|
createdAt: string;
|
|
2195
2195
|
runId: string;
|
|
2196
|
+
attempts: string;
|
|
2196
2197
|
envId: string;
|
|
2197
2198
|
orgId: string;
|
|
2198
|
-
attempts: string;
|
|
2199
2199
|
createdAtMicros?: string | undefined;
|
|
2200
2200
|
materialised?: "true" | "false" | undefined;
|
|
2201
2201
|
idempotencyLookupKey?: string | undefined;
|
|
@@ -2303,6 +2303,9 @@ declare class MollifierBuffer {
|
|
|
2303
2303
|
releaseClaim(input: IdempotencyLookupInput & {
|
|
2304
2304
|
token: string;
|
|
2305
2305
|
}): Promise<void>;
|
|
2306
|
+
resetResolvedClaim(input: IdempotencyLookupInput & {
|
|
2307
|
+
expectedRunId: string;
|
|
2308
|
+
}): Promise<boolean>;
|
|
2306
2309
|
readClaim(input: IdempotencyLookupInput): Promise<IdempotencyClaimResult | null>;
|
|
2307
2310
|
lookupIdempotency(input: IdempotencyLookupInput): Promise<string | null>;
|
|
2308
2311
|
resetIdempotency(input: IdempotencyLookupInput): Promise<{
|
package/dist/index.d.ts
CHANGED
|
@@ -2177,9 +2177,9 @@ declare const BufferEntrySchema: z.ZodObject<{
|
|
|
2177
2177
|
payload: string;
|
|
2178
2178
|
createdAt: Date;
|
|
2179
2179
|
runId: string;
|
|
2180
|
+
attempts: number;
|
|
2180
2181
|
envId: string;
|
|
2181
2182
|
orgId: string;
|
|
2182
|
-
attempts: number;
|
|
2183
2183
|
createdAtMicros: number;
|
|
2184
2184
|
materialised: boolean;
|
|
2185
2185
|
idempotencyLookupKey: string;
|
|
@@ -2193,9 +2193,9 @@ declare const BufferEntrySchema: z.ZodObject<{
|
|
|
2193
2193
|
payload: string;
|
|
2194
2194
|
createdAt: string;
|
|
2195
2195
|
runId: string;
|
|
2196
|
+
attempts: string;
|
|
2196
2197
|
envId: string;
|
|
2197
2198
|
orgId: string;
|
|
2198
|
-
attempts: string;
|
|
2199
2199
|
createdAtMicros?: string | undefined;
|
|
2200
2200
|
materialised?: "true" | "false" | undefined;
|
|
2201
2201
|
idempotencyLookupKey?: string | undefined;
|
|
@@ -2303,6 +2303,9 @@ declare class MollifierBuffer {
|
|
|
2303
2303
|
releaseClaim(input: IdempotencyLookupInput & {
|
|
2304
2304
|
token: string;
|
|
2305
2305
|
}): Promise<void>;
|
|
2306
|
+
resetResolvedClaim(input: IdempotencyLookupInput & {
|
|
2307
|
+
expectedRunId: string;
|
|
2308
|
+
}): Promise<boolean>;
|
|
2306
2309
|
readClaim(input: IdempotencyLookupInput): Promise<IdempotencyClaimResult | null>;
|
|
2307
2310
|
lookupIdempotency(input: IdempotencyLookupInput): Promise<string | null>;
|
|
2308
2311
|
resetIdempotency(input: IdempotencyLookupInput): Promise<{
|
package/dist/index.js
CHANGED
|
@@ -17000,6 +17000,20 @@ var MollifierBuffer = class {
|
|
|
17000
17000
|
const claimKey = makeIdempotencyClaimKey(input);
|
|
17001
17001
|
await this.redis.releaseMollifierClaim(claimKey, `${PENDING_PREFIX}${input.token}`);
|
|
17002
17002
|
}
|
|
17003
|
+
// Reopen a RESOLVED claim slot whose winner was cleared, so the claim-loser
|
|
17004
|
+
// reacquire path can re-serialise a cross-DB recreate through a fresh claim.
|
|
17005
|
+
// Compare-and-delete on the observed `expectedRunId` (never an unconditional
|
|
17006
|
+
// DEL) so a concurrent reacquirer that already re-published a NEW winner is
|
|
17007
|
+
// never wiped. Reuses the lookup self-heal's compare-and-delete Lua. Returns
|
|
17008
|
+
// true if the stale slot was cleared.
|
|
17009
|
+
async resetResolvedClaim(input) {
|
|
17010
|
+
const claimKey = makeIdempotencyClaimKey(input);
|
|
17011
|
+
const deleted = await this.redis.delMollifierKeyIfEquals(
|
|
17012
|
+
claimKey,
|
|
17013
|
+
input.expectedRunId
|
|
17014
|
+
);
|
|
17015
|
+
return deleted === 1;
|
|
17016
|
+
}
|
|
17003
17017
|
// Read the current claim value, used by the wait/poll loop on losers
|
|
17004
17018
|
// to detect "pending" → "resolved" transitions and timeouts.
|
|
17005
17019
|
async readClaim(input) {
|