Alvin3y1 commited on
Commit
826a00c
·
verified ·
1 Parent(s): 4675f81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -120,18 +120,24 @@ def start_system():
120
 
121
  def maintain_antigravity():
122
  while True:
123
- chrome_running = False
124
  for proc in psutil.process_iter(['name']):
125
  try:
126
- if 'chrome' in proc.info['name']:
127
- chrome_running = True
 
128
  break
129
  except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
130
  pass
131
 
132
- if not chrome_running:
133
- subprocess.Popen(["python", "-m", "antigravity"])
134
- time.sleep(5)
 
 
 
 
 
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