Update app.py
Browse files
app.py
CHANGED
|
@@ -37,16 +37,20 @@ def run_cron_setup():
|
|
| 37 |
token = os.getenv("TOKEN_ZCRON")
|
| 38 |
if not token: raise HTTPException(status_code=500, detail="TOKEN Environment Variable missing!")
|
| 39 |
try: # Step 1: JarvisLabs Install Command
|
| 40 |
-
|
| 41 |
-
|
|
|
|
| 42 |
#install_res = subprocess.run(["pip", "install", "jarvislabs==0.2.15"], capture_output=True, text=True, check=True)
|
| 43 |
#install_stdout = install_res.stdout or "No output"
|
|
|
|
| 44 |
# Step 2: Setup Command with Token
|
| 45 |
setup_cmd = f"jl setup --token '{token}' --yes"
|
| 46 |
setup_res = run_remote_cmd(setup_cmd)
|
| 47 |
setup_stdout = setup_res.get("stdout", "No output")
|
|
|
|
| 48 |
#setup_res = subprocess.run(setup_cmd, shell=True, capture_output=True, text=True, check=True)
|
| 49 |
#setup_stdout = setup_res.stdout or "No output"
|
|
|
|
| 50 |
return {"status": "success", "message": "Cron execution completed!",
|
| 51 |
"details": {"install_logs": install_stdout, "setup_logs": setup_stdout}}
|
| 52 |
# Handle the Exception
|
|
|
|
| 37 |
token = os.getenv("TOKEN_ZCRON")
|
| 38 |
if not token: raise HTTPException(status_code=500, detail="TOKEN Environment Variable missing!")
|
| 39 |
try: # Step 1: JarvisLabs Install Command
|
| 40 |
+
install_res = run_remote_cmd("pip install jarvislabs==0.2.15")
|
| 41 |
+
install_stdout = install_res.get("stdout", "No output")
|
| 42 |
+
################################################################################################################################
|
| 43 |
#install_res = subprocess.run(["pip", "install", "jarvislabs==0.2.15"], capture_output=True, text=True, check=True)
|
| 44 |
#install_stdout = install_res.stdout or "No output"
|
| 45 |
+
################################################################################################################################
|
| 46 |
# Step 2: Setup Command with Token
|
| 47 |
setup_cmd = f"jl setup --token '{token}' --yes"
|
| 48 |
setup_res = run_remote_cmd(setup_cmd)
|
| 49 |
setup_stdout = setup_res.get("stdout", "No output")
|
| 50 |
+
#################################################################################################################################
|
| 51 |
#setup_res = subprocess.run(setup_cmd, shell=True, capture_output=True, text=True, check=True)
|
| 52 |
#setup_stdout = setup_res.stdout or "No output"
|
| 53 |
+
#################################################################################################################################
|
| 54 |
return {"status": "success", "message": "Cron execution completed!",
|
| 55 |
"details": {"install_logs": install_stdout, "setup_logs": setup_stdout}}
|
| 56 |
# Handle the Exception
|