protae5544 commited on
Commit
abf4857
·
verified ·
1 Parent(s): 71d1a5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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=int(os.getenv("PORT", 7860))
 
 
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
+ )