Skip to content

Commit

Permalink
Allow immediate downloads using current time
Browse files Browse the repository at this point in the history
  • Loading branch information
tekktrik committed Feb 13, 2024
1 parent 2dfa879 commit 1bbb827
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion scripts/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@

current_datetime = datetime.datetime.now(dateutil.tz.gettz())

next_datetime = current_datetime + datetime.timedelta(minutes=10)
if "--now" in sys.argv:
delay = 0
else:
delay = 10

next_datetime = current_datetime + datetime.timedelta(minutes=delay)
next_datetime_str = next_datetime.strftime(DATETIME_FMT)

base_dir = pathlib.Path(sys.argv[1])
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ REPOPATH=$(realpath .)
PATH="$REPOPATH/.venv/bin:$PATH"
SCRIPTPATH="$REPOPATH/scripts/graphql.py"

python "$SCRIPTPATH" "$REPOPATH"
python "$SCRIPTPATH" "$REPOPATH" --now

0 comments on commit 1bbb827

Please sign in to comment.