Arafath10 commited on
Commit
2143b44
1 Parent(s): 76b6132

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +23 -2
main.py CHANGED
@@ -10,7 +10,7 @@ app = FastAPI()
10
 
11
  @app.on_event("startup")
12
  @repeat_every(seconds=60 * 12) # 1 hour
13
- def refresh_the_api():
14
 
15
  url = "https://research-project-h4fb.onrender.com/refresh_api"
16
 
@@ -26,6 +26,27 @@ def refresh_the_api():
26
 
27
 
28
  @app.get("/test")
29
- def read_root():
30
  return {"message":"running"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
 
10
 
11
  @app.on_event("startup")
12
  @repeat_every(seconds=60 * 12) # 1 hour
13
+ async def refresh_the_api():
14
 
15
  url = "https://research-project-h4fb.onrender.com/refresh_api"
16
 
 
26
 
27
 
28
  @app.get("/test")
29
+ async def read_root():
30
  return {"message":"running"}
31
+
32
+
33
+ @app.get("/start_model_trigger")
34
+ async def model_trigger(page_starting_point:str):
35
+ while True:
36
+ page = str(page)
37
+ url = "https://api-ai-service.transexpress.lk/trigger_the_data_fecher?page="+page+"&paginate=10000"
38
+ print(url,page)
39
+
40
+ payload = {}
41
+ headers = {
42
+ 'accept': 'application/json'
43
+ }
44
+
45
+ #response = requests.request("GET", url, headers=headers, data=payload)
46
+
47
+ #print(response.text)
48
+
49
+ page = int(page)
50
+ page = page + 1
51
+
52