Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -33,6 +33,7 @@ async def read_root():
|
|
33 |
@app.get("/start_model_trigger")
|
34 |
async def model_trigger(page:int):
|
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)
|
@@ -45,6 +46,7 @@ async def model_trigger(page:int):
|
|
45 |
response = requests.request("GET", url, headers=headers, data=payload)
|
46 |
page = int(page)+1
|
47 |
print(response.text)
|
|
|
48 |
break
|
49 |
return page
|
50 |
|
|
|
33 |
@app.get("/start_model_trigger")
|
34 |
async def model_trigger(page:int):
|
35 |
while True:
|
36 |
+
try:
|
37 |
page = str(page)
|
38 |
url = "https://api-ai-service.transexpress.lk/trigger_the_data_fecher?page="+page+"&paginate=10000"
|
39 |
print(url,page)
|
|
|
46 |
response = requests.request("GET", url, headers=headers, data=payload)
|
47 |
page = int(page)+1
|
48 |
print(response.text)
|
49 |
+
except:
|
50 |
break
|
51 |
return page
|
52 |
|