Update app.py
Browse files
app.py
CHANGED
|
@@ -35,12 +35,14 @@ async def upload_sink(file: UploadFile = File(...)):
|
|
| 35 |
|
| 36 |
dt = time.time() - start
|
| 37 |
mb = total / (1024**2)
|
| 38 |
-
|
| 39 |
"filename": file.filename,
|
| 40 |
"received_mb": round(mb, 2),
|
| 41 |
"duration_sec": round(dt, 2),
|
| 42 |
"throughput_mb_s": round(mb / dt, 2) if dt > 0 else 0.0,
|
| 43 |
}
|
|
|
|
|
|
|
| 44 |
|
| 45 |
# Optional: print PORT for debugging in container logs
|
| 46 |
print("DEBUG PORT env:", os.environ.get("PORT"), flush=True)
|
|
|
|
| 35 |
|
| 36 |
dt = time.time() - start
|
| 37 |
mb = total / (1024**2)
|
| 38 |
+
resp = {
|
| 39 |
"filename": file.filename,
|
| 40 |
"received_mb": round(mb, 2),
|
| 41 |
"duration_sec": round(dt, 2),
|
| 42 |
"throughput_mb_s": round(mb / dt, 2) if dt > 0 else 0.0,
|
| 43 |
}
|
| 44 |
+
print("receiving:", resp)
|
| 45 |
+
return resp
|
| 46 |
|
| 47 |
# Optional: print PORT for debugging in container logs
|
| 48 |
print("DEBUG PORT env:", os.environ.get("PORT"), flush=True)
|