nofify_status_to_ping #73

Merged
narenas merged 2 commits from nofify_status_to_ping into main 2026-05-07 20:45:26 +02:00
3 changed files with 11 additions and 0 deletions

View File

@ -5,6 +5,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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [8.5.3] - 2026-05-07
### Added
- Report `busy` and `st` fields in the periodic heartbeat ping to ogCore, so ogCore can update the client status without waiting for a command response. `busy` is `true` while a job is running; `st` indicates the base OS type (`OGL`, `LNX`, `WIN`, `OSX`)
## [8.5.2] - 2026-04-28 ## [8.5.2] - 2026-04-28
### Fixed ### Fixed

View File

@ -125,9 +125,12 @@ class OpenGnSysWorker(ServerWorker):
time.sleep(1) time.sleep(1)
n += 1 n += 1
if not n % 10: if not n % 10:
_st_map = {'linux': 'LNX', 'macos': 'OSX', 'windows': 'WIN'}
body = { body = {
"iph": self.interface.ip, "iph": self.interface.ip,
"timestamp": int(time.time()), "timestamp": int(time.time()),
"busy": any(j['p'].poll() is None for j in self.jobmgr.jobs.values()),
"st": _st_map.get(operations.os_type.lower(), 'UNK'),
} }
result = self.REST.sendMessage('clients/status/webhook', body) result = self.REST.sendMessage('clients/status/webhook', body)
if result is None: if result is None:

View File

@ -260,6 +260,8 @@ class ogLiveWorker(ServerWorker):
body = { body = {
'iph': self.IPlocal, 'iph': self.IPlocal,
'timestamp': int (time.time()), 'timestamp': int (time.time()),
'busy': any(elem['running'] for elem in self.thread_list.values()),
'st': 'OGL',
} }
#logger.debug (f'about to send ping ({body})') #logger.debug (f'about to send ping ({body})')
self.REST.sendMessage ('clients/status/webhook', body) self.REST.sendMessage ('clients/status/webhook', body)