Skip to content

Commit

Permalink
Update api.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Highfire1 authored Oct 30, 2024
1 parent b050bad commit 2c9ca19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def daily(use_cache: bool = False):
# have to run our scraping in a separate thread
def thread_task():
# hourly()
daily()
# daily()
while True:
run_pending()
time.sleep(1)

thread = Thread(target=thread_task)
thread.start()

Expand Down Expand Up @@ -113,6 +113,7 @@ async def lifespan(app: FastAPI):
print("Database found.")
controller.create_db_and_tables()
hourly(use_cache=True)
controller.checkIfNextSemesterExistsAndUpdate()
else:
print("Database not found. Building database from scratch.")
# save results to cache if cache doesn't exist
Expand Down

0 comments on commit 2c9ca19

Please sign in to comment.