Skip to content

Commit d517125

Browse files
committed
make cherrypy server settings editable for the user
1 parent e9601fe commit d517125

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

source/mycherrypy.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[global]
2+
server.socket_host = '0.0.0.0'
3+
server.socket_timeout = 60 # increase timeout to 60s
4+
server.thread_pool = 10 # default number of worker threads to start up in the pool
5+
request.show_tracebacks = False
6+
log.screen = False # turn off logging to console
7+
tools.encode.on = True
8+
tools.encode.encoding = 'utf-8'

source/zimonGrafanaIntf.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -629,16 +629,12 @@ def updateCherrypyConf(args):
629629
accesslog = os.path.join(path, 'cherrypy_access.log')
630630
errorlog = os.path.join(path, 'cherrypy_error.log')
631631

632-
globalConfig = {'global': {'server.socket_host': '0.0.0.0',
633-
'server.socket_port': args.port,
634-
'server.socket_timeout': 60, # increase timeout to 60s
635-
'request.show_tracebacks': False,
636-
'log.screen': False, # turn off logging to console
632+
globalConfig = {'global': {'server.socket_port': args.port,
637633
'log.access_file': accesslog,
638-
'log.error_file': errorlog,
639-
'tools.encode.on': True,
640-
'tools.encode.encoding': 'utf-8'}}
634+
'log.error_file': errorlog}}
635+
641636
cherrypy.config.update(globalConfig)
637+
cherrypy.config.update('./mycherrypy.conf')
642638

643639

644640
def updateCherrypySslConf(args, certFile, keyFile):

0 commit comments

Comments
 (0)