Geek7 commited on
Commit
9fc5a51
·
verified ·
1 Parent(s): 088584c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,8 +2,8 @@ import os
2
  import subprocess
3
 
4
  if __name__ == "__main__":
5
- try:
6
- # Run the Flask app using Gunicorn with 4 worker processes
7
- subprocess.run(["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "myapp:myapp"], check=True)
8
- except subprocess.CalledProcessError as e:
9
- print(f"An error occurred while running the application: {e}")
 
2
  import subprocess
3
 
4
  if __name__ == "__main__":
5
+ # Run awake.py in the background
6
+ subprocess.Popen(["python", "wk.py"]) # Start awake.py
7
+
8
+ # Run the Flask app using Gunicorn
9
+ os.system("gunicorn -w 4 -b 0.0.0.0:7860 myapp:myapp") # 4 worker processes