Update app.py
Browse files
app.py
CHANGED
|
@@ -120,18 +120,24 @@ def start_system():
|
|
| 120 |
|
| 121 |
def maintain_antigravity():
|
| 122 |
while True:
|
| 123 |
-
|
| 124 |
for proc in psutil.process_iter(['name']):
|
| 125 |
try:
|
| 126 |
-
|
| 127 |
-
|
|
|
|
| 128 |
break
|
| 129 |
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
| 130 |
pass
|
| 131 |
|
| 132 |
-
if not
|
| 133 |
-
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
time.sleep(2)
|
| 137 |
|
|
|
|
| 120 |
|
| 121 |
def maintain_antigravity():
|
| 122 |
while True:
|
| 123 |
+
antigravity_running = False
|
| 124 |
for proc in psutil.process_iter(['name']):
|
| 125 |
try:
|
| 126 |
+
# Check for exact name 'antigravity'
|
| 127 |
+
if 'antigravity' in proc.info['name']:
|
| 128 |
+
antigravity_running = True
|
| 129 |
break
|
| 130 |
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
| 131 |
pass
|
| 132 |
|
| 133 |
+
if not antigravity_running:
|
| 134 |
+
logger.warning("Antigravity not found. Launching...")
|
| 135 |
+
# We assume the binary is simply named 'antigravity' and available in PATH
|
| 136 |
+
try:
|
| 137 |
+
subprocess.Popen(["antigravity"])
|
| 138 |
+
time.sleep(5)
|
| 139 |
+
except Exception as e:
|
| 140 |
+
logger.error(f"Failed to launch antigravity: {e}")
|
| 141 |
|
| 142 |
time.sleep(2)
|
| 143 |
|