Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -229,7 +229,7 @@ def create_receipt_pdf(request_number, english_name, foreign_reference_number, i
|
|
229 |
# ลบไฟล์ชั่วคราว
|
230 |
if os.path.exists(local_path):
|
231 |
os.remove(local_path)
|
232 |
-
if os.path.exists(qr_img_path):
|
233 |
os.remove(qr_img_path)
|
234 |
|
235 |
# ตรวจสอบข้อมูล
|
@@ -383,6 +383,8 @@ with gr.Blocks(title="ระบบจัดการข้อมูลพนั
|
|
383 |
|
384 |
# เริ่มต้นแอปพลิเคชัน
|
385 |
if __name__ == "__main__":
|
|
|
386 |
demo.launch(
|
387 |
server_name="0.0.0.0",
|
388 |
-
server_port=
|
|
|
|
229 |
# ลบไฟล์ชั่วคราว
|
230 |
if os.path.exists(local_path):
|
231 |
os.remove(local_path)
|
232 |
+
if 'qr_img_path' in locals() and os.path.exists(qr_img_path):
|
233 |
os.remove(qr_img_path)
|
234 |
|
235 |
# ตรวจสอบข้อมูล
|
|
|
383 |
|
384 |
# เริ่มต้นแอปพลิเคชัน
|
385 |
if __name__ == "__main__":
|
386 |
+
port = int(os.getenv("PORT", 7860))
|
387 |
demo.launch(
|
388 |
server_name="0.0.0.0",
|
389 |
+
server_port=port
|
390 |
+
)
|