Merge pull request 'refs #2600 wait() for the browser' (#54) from wait-browser into main

Reviewed-on: #54
main 7.3.3
Natalia Serrano 2025-08-07 12:10:36 +02:00
commit 0d7ef61393
4 changed files with 20 additions and 2 deletions

View File

@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [7.3.3] - 2025-08-07
### Fixed
- wait() for the browser
## [7.3.2] - 2025-08-04
### Fixed

View File

@ -1,3 +1,9 @@
ogagent (7.3.3-1) stable; urgency=medium
* wait() for the browser
-- OpenGnsys developers <info@opengnsys.es> Thu, 07 Aug 2025 12:08:39 +0200
ogagent (7.3.2-1) stable; urgency=medium
* Fix syntax

View File

@ -1 +1 @@
7.3.2
7.3.3

View File

@ -210,6 +210,11 @@ class ogLiveWorker(ServerWorker):
def mon (self):
n = 0
while True:
if self.browser_process is not None:
try:
self.browser_process.wait (0.05)
except subprocess.TimeoutExpired:
pass
with self.thread_lock:
for k in self.thread_list:
elem = self.thread_list[k]
@ -399,7 +404,7 @@ class ogLiveWorker(ServerWorker):
if 'ServiceUnknown' in str(e):
logger.warning ('browser is not running, launching a new one')
browser_log_fd = open ('/var/log/launch_browser.log', 'a')
subprocess.Popen (['/usr/bin/launch_browser', url], stdout=browser_log_fd, stderr=subprocess.STDOUT)
self.browser_process = subprocess.Popen (['/usr/bin/launch_browser', url], stdout=browser_log_fd, stderr=subprocess.STDOUT)
browser_log_fd.close()
else:
logger.error (f'Error al cambiar URL: ({e})')
@ -459,6 +464,7 @@ class ogLiveWorker(ServerWorker):
self.pid_q = None ## for passing PIDs around
self.stdout_q = None ## for passing stdout
self.progress_jobs = {}
self.browser_process = None
ogcore_scheme = os.environ.get ('OGAGENTCFG_OGCORE_SCHEME', 'https')
ogcore_ip = os.environ.get ('OGAGENTCFG_OGCORE_IP', '192.168.2.1')