Skip to content

Commit

Permalink
wb | nomad: mark token as expired 24 hours earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed Jan 11, 2024
1 parent b7f8618 commit ed63172
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nix/workbench/nomad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ wb_nomad() {
then
local expire_time
expire_time=$(echo "${token_lookup_response}" | jq -r .data.expire_time)
if test "$(date -u -d "${expire_time}" "+%s")" -ge "$(date -u "+%s")"
# Compare expire date with the actual date minus one day.
# This avoids a token expiring while a profile is running.
if test "$(date -u -d "${expire_time}" "+%s")" -ge "$(($(date -u "+%s") - 86400))"
then
true
else
Expand Down

0 comments on commit ed63172

Please sign in to comment.