Update main.py
Browse files
main.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
from fastapi import FastAPI, File, UploadFile
|
2 |
from fastapi.responses import StreamingResponse
|
|
|
3 |
import os
|
4 |
import io
|
5 |
import requests
|
@@ -8,7 +9,7 @@ app = FastAPI()
|
|
8 |
|
9 |
|
10 |
@app.on_event("startup")
|
11 |
-
@repeat_every(seconds=60 *
|
12 |
def refresh_the_api():
|
13 |
|
14 |
url = "https://research-project-h4fb.onrender.com/refresh_api"
|
|
|
1 |
from fastapi import FastAPI, File, UploadFile
|
2 |
from fastapi.responses import StreamingResponse
|
3 |
+
from fastapi_utils.tasks import repeat_every
|
4 |
import os
|
5 |
import io
|
6 |
import requests
|
|
|
9 |
|
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"
|