Skip to content

Commit 7c16590

Browse files
committed
Make sure maxTtl is enforced even when the ttl option passed in does not parse correctly
1 parent 3ee9180 commit 7c16590

File tree

1 file changed

+5
-1
lines changed
  • internal-packages/run-engine/src/engine

1 file changed

+5
-1
lines changed

internal-packages/run-engine/src/engine/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2284,10 +2284,14 @@ export class RunEngine {
22842284
const ttlMs = parseNaturalLanguageDurationInMs(ttl);
22852285
const maxTtlMs = parseNaturalLanguageDurationInMs(maxTtl);
22862286

2287-
if (ttlMs === undefined || maxTtlMs === undefined) {
2287+
if (maxTtlMs === undefined) {
22882288
return ttl;
22892289
}
22902290

2291+
if (ttlMs === undefined) {
2292+
return maxTtl;
2293+
}
2294+
22912295
return ttlMs <= maxTtlMs ? ttl : maxTtl;
22922296
}
22932297

0 commit comments

Comments
 (0)