From b2ddd39d5f01cc3721cdd8a3a6d37e3448c12164 Mon Sep 17 00:00:00 2001 From: manatlan Date: Sun, 15 Oct 2023 13:56:52 +0200 Subject: [PATCH] fix tag_update --- htagweb/server/__init__.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/htagweb/server/__init__.py b/htagweb/server/__init__.py index 37f4f9b..fb70c50 100644 --- a/htagweb/server/__init__.py +++ b/htagweb/server/__init__.py @@ -9,7 +9,6 @@ import asyncio,traceback,os import signal,platform -import redys import redys.v2 import os,sys,importlib,inspect import time @@ -143,8 +142,17 @@ async def update(actions): log("tag.update not possible (http only)") #====================================== - await registerHrProcess(bus,hid,FactorySession.__name__,pid) time_activity = time.monotonic() + + await registerHrProcess(bus,hid,dict( + sesprovider=FactorySession.__name__, + pid=pid, + timeout_inactivity=timeout_inactivity, + http_only = not useUpdate, + timestamp = time_activity, + ) + ) + try: # publish the 1st rendering @@ -209,12 +217,12 @@ async def update(actions): asyncio.run( loop() ) log("end") -async def registerHrProcess(bus,hid:Hid,sesprovider:str,pid:int): +async def registerHrProcess(bus,hid:Hid,info:dict): # register hid in redys "apps" await bus.sadd(KEYAPPS,str(hid)) # save sesprovider for this hid - await bus.set(hid.KEY_SYSINFO, dict(sesprovider=sesprovider,pid=pid)) + await bus.set(hid.KEY_SYSINFO, info) # subscribe for interaction await bus.subscribe( hid.EVENT_INTERACT ) @@ -283,6 +291,10 @@ async def session(self,hid:Hid) -> dict: FactorySession=importFactorySession(sesprovidername) return FactorySession(hid.uid) + async def info(self,hid:Hid) -> dict: + """ get infos from hid""" + return await self._bus.get(hid.KEY_SYSINFO) + ################################################################################## async def startServer():