Spaces:
Running
Running
File size: 390 Bytes
40eae7a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import sys
import os
import requests
import time
import subprocess
sys.path.append(os.getcwd())
proc = subprocess.Popen([".venv/bin/python", "app.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
time.sleep(25)
if proc.poll() is not None:
print("App crashed!")
out, err = proc.communicate()
print(err.decode())
else:
print("App running successfully.")
proc.kill()
|