Skip to content

Commit

Permalink
Add reference for duration formats
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Jun 2, 2024
1 parent 7c2c8d7 commit 6db58d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ This action starts immediately but ignores the job missing in the first 5 minute
- No need to extend `wait-seconds-before-first-polling`
- Disable `optional`, because it is needed to check
- Set enough value for `startupGracePeriod` for this purpose.\
It should be parsible with [Temporal.Duration.from()](https://github.com/tc39/proposal-temporal)\
It should be parsible with [TC39 - Temporal.Duration](https://github.com/tc39/proposal-temporal/blob/26e4cebe3c49f56932c1d5064fec9993e981823a/docs/duration.md)\
e.g
- `"PT1M"` # ISO8601 duration format
- `{ "minutes": 3, "seconds": 20 }` # key-value for each unit
- `"PT3M42S"` # ISO 8601 duration format
- `{ "minutes": 3, "seconds": 42 }` # key-value for each unit

If not using wait-list, this pattern should be considered in your `wait-seconds-before-first-polling`.

Expand Down
2 changes: 2 additions & 0 deletions src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const MyDurationLike = z.object({

type MyDurationLike = z.infer<typeof MyDurationLike>;

// IETF does not define duration formats in their RFCs, but in RFC 3399 refers ISO 8601 duration formats.
// https://www.ietf.org/rfc/rfc3339.txt
const Durationable = z.union([z.string().duration(), MyDurationLike]);
type Dirationable = z.infer<typeof Durationable>;

Expand Down

0 comments on commit 6db58d9

Please sign in to comment.