Skip to content

Commit

Permalink
Adding a "thismonth" option to the date argument for fetch_crashids (#…
Browse files Browse the repository at this point in the history
…6822)

This adds a "thismonth" value to the value domain for the `--date"
argument because it's not uncommon to be testing signature generation
changes for situations that have happened in the last month, but not in
the last week.
  • Loading branch information
willkg authored Nov 29, 2024
1 parent 8d6449d commit e979da2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions socorro/scripts/fetch_crashids.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def fetch_crashids(host, params, num_results):
MAX_PAGE,
# The number of results Super Search can return to us that is hasn't returned so far
total - crashids_count,
# The numver of results we want that we haven't gotten, yet
# The number of results we want that we haven't gotten, yet
num_results - crashids_count,
)

Expand Down Expand Up @@ -137,8 +137,8 @@ def main(argv=None):
"--date",
default="",
help=(
'date to pull crash ids from as YYYY-MM-DD, "thisweek", "yesterday", '
+ '"today", or "now"; defaults to "yesterday"'
'date to pull crash ids from as YYYY-MM-DD, "thismonth", "thisweek", '
+ '"yesterday", "today", or "now"; defaults to "yesterday"'
),
)
parser.add_argument(
Expand Down Expand Up @@ -200,6 +200,10 @@ def main(argv=None):
enddate = enddate.strftime("%Y-%m-%dT%H:%M:%S.000Z")
params["_sort"] = "-date"

elif datestamp == "thismonth":
startdate = utc_now() - datetime.timedelta(days=30)
enddate = utc_now() + datetime.timedelta(days=1)

elif datestamp == "thisweek":
startdate = utc_now() - datetime.timedelta(days=7)
enddate = utc_now() + datetime.timedelta(days=1)
Expand Down

0 comments on commit e979da2

Please sign in to comment.