Skip to content

Commit

Permalink
im really good at coding
Browse files Browse the repository at this point in the history
  • Loading branch information
Highfire1 committed Dec 4, 2024
1 parent 7b3e7b7 commit 58b5a11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions sdk/fetch_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def updateDataFromNotion(writeLocation="data/") -> bool:
for page in event_pages["results"]:
p = page["properties"]
stale_data = False
found = False

for event in local_data.events:
if event.id == page["id"]:
Expand All @@ -60,11 +59,14 @@ def updateDataFromNotion(writeLocation="data/") -> bool:
stale_data = True
break

if not stale_data or not found:
if not stale_data:
update_count += 1
if page["last_edited_time"] > events_latest_update and found:
if page["last_edited_time"] > events_latest_update:
events_latest_update = page["last_edited_time"]


if len(local_data.events) != len(event_pages["results"]):
update_count += 1

# if there are no new updates then we should save the time that we last checked and then exit.
if update_count == 0:
current_time = datetime.now(timezone.utc)
Expand Down
8 changes: 5 additions & 3 deletions sdk/fetch_execs.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def updateDataFromNotion(writeLocation="data/") -> bool:
for page in exec_pages["results"]:
p = page["properties"]
stale_data = False
found = False

for exec in local_data.executives:
if exec.id == page["id"]: # Compare with page_id
Expand All @@ -78,11 +77,14 @@ def updateDataFromNotion(writeLocation="data/") -> bool:
stale_data = True
break

if not stale_data or not found:
if not stale_data:
update_count += 1
if page["last_edited_time"] > execs_latest_update and found:
if page["last_edited_time"] > execs_latest_update:
execs_latest_update = page["last_edited_time"]

if len(local_data.events) != len(exec_pages["results"]):
update_count += 1

# if there are no new updates then we should save the time that we last checked and then exit.
if update_count == 0:
current_time = datetime.now(timezone.utc)
Expand Down

0 comments on commit 58b5a11

Please sign in to comment.