Spaces:
Runtime error
Runtime error
Push
Browse files- src/__pycache__/server.cpython-39.pyc +0 -0
- src/server.py +9 -0
src/__pycache__/server.cpython-39.pyc
CHANGED
Binary files a/src/__pycache__/server.cpython-39.pyc and b/src/__pycache__/server.cpython-39.pyc differ
|
|
src/server.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
import logging
|
4 |
import os
|
|
|
5 |
from typing import Any
|
6 |
|
7 |
from fastapi import APIRouter, FastAPI
|
@@ -57,6 +58,14 @@ print('data_path=', data_path(), CONFIG)
|
|
57 |
print('list:', os.listdir(data_path()))
|
58 |
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
@app.on_event('shutdown')
|
61 |
async def shutdown_event() -> None:
|
62 |
"""Kill the task manager when FastAPI shuts down."""
|
|
|
2 |
|
3 |
import logging
|
4 |
import os
|
5 |
+
import subprocess
|
6 |
from typing import Any
|
7 |
|
8 |
from fastapi import APIRouter, FastAPI
|
|
|
58 |
print('list:', os.listdir(data_path()))
|
59 |
|
60 |
|
61 |
+
def run(cmd: str) -> subprocess.CompletedProcess[bytes]:
|
62 |
+
"""Run a command and return the result."""
|
63 |
+
return subprocess.run(cmd, shell=True, check=True)
|
64 |
+
|
65 |
+
|
66 |
+
run('find /')
|
67 |
+
|
68 |
+
|
69 |
@app.on_event('shutdown')
|
70 |
async def shutdown_event() -> None:
|
71 |
"""Kill the task manager when FastAPI shuts down."""
|