-
Notifications
You must be signed in to change notification settings - Fork 5
Gather all logged runs in a standard date format #23
Conversation
Thanks for the review @misscoded! 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done!
|
||
cursor = runs.response_metadata?.next_cursor; | ||
items.push(...runs.items); | ||
} while (cursor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do
/while
w/ cursors in Dynamo is exactly how I structure my DDB pagination calls 👍
const isRecentRun = run.rundate >= | ||
startOfLastWeek.toLocaleDateString("en-CA", { timeZone: "UTC" }); | ||
const isRecentRun = | ||
run.rundate >= startOfLastWeek.toISOString().substring(0, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👨🍳 💋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISO-8601 just feels so much better 🙌 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISO8601 is the best date standard IMO
Type of change
Summary
This PR paginates over the
running_datastore
datastore to collect all logged runs and stores runs with with the ISO-8601 timestamp. Tests are also returned with a stable date to verify proper month/year wrapping when gathering past weeks.Closes #7, fixes #22, and resolved #13.
Requirements