@@ -234,7 +234,7 @@ def create_historical(cik, company, stamp):
234234 database .add_log (
235235 cik , "Failed to Update Filer Historical Stocks" , company_name , cik
236236 )
237- database .edit_status (cik , 0 )
237+ database .edit_status (cik , 5 )
238238
239239 allocation_list = analysis .analyze_allocation (cik )
240240 aum_list = analysis .analyze_aum (cik )
@@ -252,9 +252,11 @@ def create_historical(cik, company, stamp):
252252
253253 except Exception as e :
254254 report_error (cik , e )
255+ database .edit_status (5 )
255256 database .add_log (
256257 cik , "Failed to Query Filer Historical Stocks" , company_name , cik
257258 )
259+ return
258260
259261 start = stamp ["start" ]
260262 stamp = {"time.elapsed" : datetime .now ().timestamp () - start , "logs" : []}
@@ -307,7 +309,7 @@ def update_filer(company, background: BackgroundTasks = BackgroundTasks):
307309 302 , detail = "Filer is partially building."
308310 )
309311 elif operation ["status" ] >= 2 :
310- raise HTTPException (409 , detail = "Filer still building." )
312+ raise HTTPException (409 , detail = "Filer still building." ) # @IgnoreException
311313
312314 update , last_report = web .check_new (cik )
313315 if not update :
@@ -506,7 +508,7 @@ async def logs(cik: str, start: int = 0):
506508 raise HTTPException (404 , detail = "CIK not found." )
507509 except Exception as e :
508510 logging .error (e )
509- raise HTTPException (500 , detail = "Error fetching logs." )
511+ raise HTTPException (500 , detail = "Error fetching logs." ) # @IgnoreException
510512
511513
512514@router .get ("/estimate" , status_code = 202 )
@@ -538,7 +540,9 @@ async def estimate(cik: str):
538540 raise HTTPException (404 , detail = "CIK not found." )
539541 except Exception as e :
540542 logging .error (e )
541- raise HTTPException (500 , detail = "Error fetching time estimation." )
543+ raise HTTPException (
544+ 500 , detail = "Error fetching time estimation." # @IgnoreException
545+ ) # @IgnoreException
542546
543547
544548@router .get ("/info" , tags = ["filers" ], status_code = 200 )
@@ -951,7 +955,7 @@ async def top_ciks():
951955 report_error ("Top CIKs" , e )
952956 raise HTTPException (500 , detail = "Error fetching filers." )
953957
954- return {"filers" : filers_sorted }
958+ return BrowserCachedResponse ( content = {"filers" : filers_sorted }, cache_hours = 1 )
955959
956960
957961popular_ciks_path = f"{ cwd } /static/popular.json"
@@ -968,7 +972,7 @@ async def popular_ciks():
968972 report_error ("Popular CIKs" , e )
969973 raise HTTPException (500 , detail = "Error fetching filers." )
970974
971- return {"filers" : filers_sorted }
975+ return BrowserCachedResponse ( content = {"filers" : filers_sorted }, cache_hours = 1 )
972976
973977
974978def create_filer_try (cik ):
0 commit comments