tracinginsights commited on
Commit
68cfcbc
·
1 Parent(s): 962c2a7

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -2
main.py CHANGED
@@ -5,6 +5,8 @@ import os
5
 
6
 
7
 
 
 
8
  app = FastAPI()
9
 
10
 
@@ -15,9 +17,12 @@ async def root():
15
  @app.get("/{year}/{race}/{session}", response_model=None)
16
  async def get_data(year: int, race: int, session: str) -> any:
17
 
18
- cache_path = os.path.abspath('Cache')
 
 
 
19
 
20
- fastf1.Cache.enable_cache(cache_path)
21
 
22
  f1session = fastf1.get_session(year, race, session)
23
  f1session.load(telemetry=False, weather=False, messages=False)
 
5
 
6
 
7
 
8
+
9
+
10
  app = FastAPI()
11
 
12
 
 
17
  @app.get("/{year}/{race}/{session}", response_model=None)
18
  async def get_data(year: int, race: int, session: str) -> any:
19
 
20
+ if not os.path.exists('Cache'):
21
+ os.makedir('Cache')
22
+
23
+
24
 
25
+ fastf1.Cache.enable_cache('Cache')
26
 
27
  f1session = fastf1.get_session(year, race, session)
28
  f1session.load(telemetry=False, weather=False, messages=False)