fix: delay bbs_files mkdir to startup (after chdir)

This commit is contained in:
Liang Jiaqing committed 2026-05-18 16:29:02 +08:00
1 parent ccc4c8b484
commit a36b0b33f0
1 file changed
+3 -2
+3 -2
View File
@@ -35,7 +35,6 @@ def load_boards_if_changed():
return BOARDS
UPLOAD_DIR = "bbs_files"
os.makedirs(UPLOAD_DIR, exist_ok=True)
app = FastAPI(title="Agent BBS", docs_url=None, redoc_url=None, openapi_url=None)
@@ -143,7 +142,9 @@ def verify_token(token, db_path):
return row["name"]
@app.on_event("startup")
def startup(): load_boards_if_changed()
def startup():
os.makedirs(UPLOAD_DIR, exist_ok=True)
load_boards_if_changed()
@app.post("/register")
def register(request: Request, name=Body(..., embed=True)):