yamanavijayavardhan commited on
Commit
03c879f
·
1 Parent(s): c1855f3

updating some error in socket in main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -2
main.py CHANGED
@@ -669,12 +669,18 @@ if __name__ == '__main__':
669
  # Start the Flask app with increased timeout
670
  from werkzeug.serving import run_simple
671
  port = int(os.environ.get('PORT', 7860))
 
 
 
 
 
 
 
672
  run_simple('0.0.0.0', port, app,
673
  use_reloader=False,
674
  threaded=True,
675
  request_handler=None,
676
  passthrough_errors=True,
677
- ssl_context=None,
678
- socket_timeout=600) # 10 minute timeout
679
  finally:
680
  cleanup_temp_files()
 
669
  # Start the Flask app with increased timeout
670
  from werkzeug.serving import run_simple
671
  port = int(os.environ.get('PORT', 7860))
672
+
673
+ # Set socket timeout using environment variable
674
+ os.environ['WERKZEUG_RUN_MAIN'] = 'true'
675
+ os.environ['WERKZEUG_SERVER_NAME'] = '0.0.0.0'
676
+ os.environ['WERKZEUG_SERVER_PORT'] = str(port)
677
+
678
+ # Run the server with proper configuration
679
  run_simple('0.0.0.0', port, app,
680
  use_reloader=False,
681
  threaded=True,
682
  request_handler=None,
683
  passthrough_errors=True,
684
+ ssl_context=None)
 
685
  finally:
686
  cleanup_temp_files()