mirror of
https://github.com/koush/scrypted.git
synced 2026-06-20 16:40:30 +01:00
server: Improve plugin health check
This commit is contained in:
@@ -754,6 +754,13 @@ class PluginRemote:
|
||||
raise Exception(f'unknown service {name}')
|
||||
|
||||
async def start_stats_runner(self):
|
||||
pong = None
|
||||
async def ping(time: int):
|
||||
nonlocal pong
|
||||
pong = pong or await self.peer.getParam('pong')
|
||||
await pong(time)
|
||||
self.peer.params['ping'] = ping
|
||||
|
||||
update_stats = await self.peer.getParam('updateStats')
|
||||
if not update_stats:
|
||||
print('host did not provide update_stats')
|
||||
|
||||
Reference in New Issue
Block a user