Skip to content

Commit

Permalink
Fix data checker ready for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
wrussell1999 committed Jan 26, 2024
1 parent 51e4f67 commit ee40144
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion git_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ def find_gl_commits(response, fellow):
collect_data()
print(f"{term} Completed")
time.sleep(30)
if datetime.datetime.now() < batch_start.timedelta(days=21):
now = datetime.datetime.now()
if now < now + datetime.timedelta(days=21):
print(f"Collecting Orientation Data for {term}")
orientation_data.collect_data(term)
print(f"Orientation Data completed for {term}")
Expand Down
6 changes: 3 additions & 3 deletions helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time
import requests
import gspread
from datetime import datetime
import datetime
from pytz import timezone
from oauth2client.service_account import ServiceAccountCredentials

Expand Down Expand Up @@ -118,8 +118,8 @@ def standardize_datetime(raw_datetime, actitivty_type):
commit_format = "%a %b %d %H:%M:%S %Y %z"

if (actitivty_type == "Pull Request" or actitivty_type == "Issue") and raw_datetime != None and raw_datetime != "Null":
return str(datetime.strptime(raw_datetime, pr_format))
return str(datetime.datetime.strptime(raw_datetime, pr_format))
if actitivty_type == "Commit" and raw_datetime != None and raw_datetime != "Null":
commit_date = datetime.strptime(raw_datetime, commit_format)
commit_date = datetime.datetime.strptime(raw_datetime, commit_format)
return str(commit_date.astimezone(timezone('GMT')))
return raw_datetime

0 comments on commit ee40144

Please sign in to comment.