From 43c57ea32037c6e65ed4f970f4d9376a7f51be98 Mon Sep 17 00:00:00 2001 From: jmbardallo Date: Wed, 22 Jul 2026 14:37:17 +0200 Subject: [PATCH] Fix(jobmgr): send START_SCRIPT webhook when script is run under user session (client=true) --- src/opengnsys/modules/server/OpenGnSys/__init__.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/opengnsys/modules/server/OpenGnSys/__init__.py b/src/opengnsys/modules/server/OpenGnSys/__init__.py index abaec46..ac3baaa 100644 --- a/src/opengnsys/modules/server/OpenGnSys/__init__.py +++ b/src/opengnsys/modules/server/OpenGnSys/__init__.py @@ -507,10 +507,20 @@ class OpenGnSysWorker(ServerWorker): def process_client_script_launched(self, data): import tempfile + job_id = data['job_id'] job_id_path = os.path.join(tempfile.gettempdir(), 'EjecutarScript-jobid') with open (job_id_path, 'w') as fd: - fd.write (data['job_id']) - self.client_jobs.add(data['job_id']) + fd.write (job_id) + self.client_jobs.add(job_id) + + try: + self.REST.sendMessage('clients/status/webhook', { + "nfn": "START_SCRIPT", + "job_id": job_id + }) + except Exception as e: + logger.error(f"Failed to send START_SCRIPT webhook for client job {job_id}: {e}") + return True def process_client_script_finished(self, data):