File size: 823 Bytes
6733714
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import uvicorn
import sys
import os

print(f"Ref CWD: {os.getcwd()}")
try:
    print(f"Ref LS: {os.listdir('.')}")
    if 'rag-backend' in os.listdir('.'):
         print(f"Ref LS (rag-backend): {os.listdir('rag-backend')}")
    if 'app' in os.listdir('.'):
         print(f"Ref LS (app): {os.listdir('app')}")
except Exception as e:
    print(f"Ref LS Error: {e}")
print(f"Ref Path: {sys.path}")

try:
    import app
    print(f"Ref app found: {app}")
except ImportError as e:
    print(f"Ref app import error: {e}")

from app.api.app import app
from app.utils.s3_sync import sync_from_s3

@app.on_event("startup")
async def startup_event():
    print("🚀 App starting... Syncing data from S3")
    sync_from_s3()

if __name__ == "__main__":
    uvicorn.run(
        app,
        host="0.0.0.0",
        port=8000
    )