[tuxdroid-svn] r5116 - software_suite_v3/smart-core/smart-server/trunk
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-07-15 12:11:18
|
Author: remi
Date: 2009-07-15 14:10:59 +0200 (Wed, 15 Jul 2009)
New Revision: 5116
Modified:
software_suite_v3/smart-core/smart-server/trunk/tuxhttpserver.py
Log:
* Updated stop server method
Modified: software_suite_v3/smart-core/smart-server/trunk/tuxhttpserver.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/tuxhttpserver.py 2009-07-15 11:51:57 UTC (rev 5115)
+++ software_suite_v3/smart-core/smart-server/trunk/tuxhttpserver.py 2009-07-15 12:10:59 UTC (rev 5116)
@@ -15,6 +15,7 @@
import sys
import os
import getopt
+import time
from util.smartcore.OldProcessKiller import killOldSmartCoreChildren
from util.smartcore.OldProcessKiller import killPreviousSmartServer
@@ -26,18 +27,23 @@
return URLTestRequestGet("127.0.0.1", TDS_HTTP_PORT, "/", 200, 5.0)
def killServer():
- killOldSmartCoreChildren()
+ # Stop the server regularly
URLTestRequestGet("127.0.0.1", TDS_HTTP_PORT, "/server/stop?", 200, 0.5)
URLTestRequestGet("127.0.0.1", TDS_HTTP_PORT, "/server/stop?", 200, 0.5)
+ # Wait 5 secs max that the previous server has been stopped
+ for i in range(10):
+ if not checkServerRun():
+ break
+ time.sleep(0.5)
+ # Kill smart-core tasks if still alive
+ killOldSmartCoreChildren()
killPreviousSmartServer()
+ # Refresh taskbar icons
refreshTaskBar()
def killServerAndWait():
- import time
killServer()
time.sleep(0.5)
- while checkServerRun():
- time.sleep(0.5)
def runServer():
killOldSmartCoreChildren()
|