Spaces:
Sleeping
Sleeping
Update app.py
Browse files41 unmodified lines4243444546474889 unmodified lines13813914014114214314435 unmodified lines18018118218318418541 unmodified linesasync def cleanup_loop():while True:await asyncio.sleep(3600) # 1時間ごとに実行now = time.time()to_delete = [tid for tid, t in list(tasks.items())89 unmodified linesraise Exception("サーバーが停止しています。管理者にお問い合わせください。")raise Exception(f"Colab接続失敗: {error_msg}")# 通常のメディア変換処理(遅延インポート)else:for i, fname in enumerate(filenames):in_f = os.path.join(input_path, fname)35 unmodified lines# --- APIエンドポイント ---@app.get("/")async def read_index():with open("index.html", "r", encoding="utf-8") as f:41 unmodified lines4243444546474889 unmodified lines13813914014114214314435 unmodified lines18018118218318418518618718818919041 unmodified linesasync def cleanup_loop():while True:await asyncio.sleep(3600)now = time.time()to_delete = [tid for tid, t in list(tasks.items())89 unmodified linesraise Exception("サーバーが停止しています。管理者にお問い合わせください。")raise Exception(f"Colab接続失敗: {error_msg}")# 通常のメディア変換処理(遅延インポートで起動時メモリを節約)else:for i, fname in enumerate(filenames):in_f = os.path.join(input_path, fname)35 unmodified lines# --- APIエンドポイント ---@app.get("/favicon.ico")async def favicon():# faviconがないと404になりヘルスチェックが失敗するため204を返すraise HTTPException(status_code=204)@app.get("/")async def read_index():with open("index.html", "r", encoding="utf-8") as f:
app.py+7-2