orc server test

dev-linux
robo-bo 2 years ago
parent 159b144107
commit a9e553e61d

@ -432,6 +432,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
try:
global gSettingsDict
self.timeout=gSettingsDict["ServerDict"]["RequestTimeoutSecFloat"]
self.settimeout(gSettingsDict["ServerDict"]["RequestTimeoutSecFloat"])
threading.current_thread().request = self
self.OpenRPA = {}
@ -522,7 +523,8 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
def do_POST(self):
try:
global gSettingsDict
self.settimeout(gSettingsDict["ServerDict"]["RequestTimeoutSecFloat"])
self.timeout=gSettingsDict["ServerDict"]["RequestTimeoutSecFloat"]
self.request.settimeout(gSettingsDict["ServerDict"]["RequestTimeoutSecFloat"])
threading.current_thread().request = self
lL = gSettingsDict["Logger"]
self.OpenRPA = {}
@ -637,6 +639,8 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
"""Handle requests in a separate thread."""
def finish_request(self, request, client_address):
try:
global gSettingsDict
request.settimeout(gSettingsDict["ServerDict"]["RequestTimeoutSecFloat"])
# "super" can not be used because BaseServer is not created from object
HTTPServer.finish_request(self, request, client_address)
except ConnectionResetError as e:

@ -1,5 +1,7 @@
import os, logging, datetime, sys
import schedule # https://schedule.readthedocs.io/en/stable/examples.html
import schedule
from pyOpenRPA.Tools import CrossOS # https://schedule.readthedocs.io/en/stable/examples.html
# Technical def - return GSettings structure with examples
def __Create__():
@ -340,7 +342,7 @@ def Create(inModeStr="BASIC", inLoggerLevel = None):
lL.setLevel(logging.INFO)
# create the logging file handler
mRobotLoggerFH = logging.FileHandler(
os.path.normpath("Reports\\" + datetime.datetime.now().strftime("%Y_%m_%d") + ".log"))
CrossOS.PathStr("Reports\\" + datetime.datetime.now().strftime("%Y_%m_%d") + ".log"))
mRobotLoggerFormatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
mRobotLoggerFH.setFormatter(mRobotLoggerFormatter)
# add handler to logger object

Loading…
Cancel
Save