Author: remi
Date: 2008-09-17 20:07:57 +0200 (Wed, 17 Sep 2008)
New Revision: 1889

Modified:
   
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/httpserver/TDServices.py
Log:
* improved the checking of the clients life

Modified: 
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/httpserver/TDServices.py
===================================================================
--- 
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/httpserver/TDServices.py
    2008-09-17 17:44:49 UTC (rev 1888)
+++ 
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/httpserver/TDServices.py
    2008-09-17 18:07:57 UTC (rev 1889)
@@ -17,6 +17,7 @@
 from TDClientController import *
 from TDError import *
 import SimpleXMLStruct
+import time
 
 DEFAULT_CONTENT_STRUCT = {
     'root' : {
@@ -110,6 +111,7 @@
         self.__accessLevel = accessLevel
         self.__clientController = clientController
         self.__headerContentFunct = None
+        self.__lastClientCheckTime = time.time()
         self.__defaultContentXML = 
SimpleXMLStruct.structToXML(copy.deepcopy(DEFAULT_CONTENT_STRUCT), 
                                                                True)
         
@@ -121,7 +123,9 @@
         content = self.__defaultContentXML
 
         # If the id client is registered
-        self.__clientController.refreshClientsTable()
+        if (self.__lastClientCheckTime + 1.0) < time.time():
+            self.__lastClientCheckTime = time.time()
+            self.__clientController.refreshClientsTable()
         if self.__clientController.clientExists(idClient):
             client = self.__clientController.getClient(idClient)
             clientLevel = client.getLevel()


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to