aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/github_utils.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-07-24 10:06:47 +0200
committerGravatar Hassan Abouelela <[email protected]>2022-07-24 10:06:47 +0200
commitf16d3b1b1d14cdf0de1e56ae2bc466152e930f34 (patch)
tree61a957e380abab3ecbe5afb50b3acd778daf7b04 /pydis_site/apps/api/github_utils.py
parentUse Dataclass For Workflow Run (diff)
Use UTC Time For GitHub API
When reading the created_at time from the GitHub API, it'll be a naive date string with UTC time, so we use that instead of the system's time. Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/apps/api/github_utils.py')
-rw-r--r--pydis_site/apps/api/github_utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pydis_site/apps/api/github_utils.py b/pydis_site/apps/api/github_utils.py
index c4ace6b7..7d26b147 100644
--- a/pydis_site/apps/api/github_utils.py
+++ b/pydis_site/apps/api/github_utils.py
@@ -148,7 +148,7 @@ def authorize(owner: str, repo: str) -> httpx.Client:
def check_run_status(run: WorkflowRun) -> str:
"""Check if the provided run has been completed, otherwise raise an exception."""
created_at = datetime.datetime.strptime(run.created_at, ISO_FORMAT_STRING)
- run_time = datetime.datetime.now() - created_at
+ run_time = datetime.datetime.utcnow() - created_at
if run.status != "completed":
if run_time <= MAX_RUN_TIME: