##// END OF EJS Templates
system-info: expose workers of vcsserver in system info data.
marcink -
r1465:c65ff93e default
parent child Browse files
Show More
@@ -476,16 +476,24 b' def vcs_backends():'
476
476
477 def vcs_server():
477 def vcs_server():
478 import rhodecode
478 import rhodecode
479 from rhodecode.lib.vcs.backends import get_vcsserver_version
479 from rhodecode.lib.vcs.backends import get_vcsserver_service_data
480
480
481 server_url = rhodecode.CONFIG.get('vcs.server')
481 server_url = rhodecode.CONFIG.get('vcs.server')
482 enabled = rhodecode.CONFIG.get('vcs.server.enable')
482 enabled = rhodecode.CONFIG.get('vcs.server.enable')
483 protocol = rhodecode.CONFIG.get('vcs.server.protocol') or 'http'
483 protocol = rhodecode.CONFIG.get('vcs.server.protocol') or 'http'
484 state = STATE_OK_DEFAULT
484 state = STATE_OK_DEFAULT
485 version = None
485 version = None
486 workers = 0
486
487
487 try:
488 try:
488 version = get_vcsserver_version()
489 data = get_vcsserver_service_data()
490 if data and 'version' in data:
491 version = data['version']
492
493 if data and 'config' in data:
494 conf = data['config']
495 workers = conf.get('workers', '?')
496
489 connection = 'connected'
497 connection = 'connected'
490 except Exception as e:
498 except Exception as e:
491 connection = 'failed'
499 connection = 'failed'
@@ -502,8 +510,9 b' def vcs_server():'
502
510
503 human_value = value.copy()
511 human_value = value.copy()
504 human_value['text'] = \
512 human_value['text'] = \
505 '{url}@ver:{ver} via {mode} mode, connection:{conn}'.format(
513 '{url}@ver:{ver} via {mode} mode[workers:{workers}], connection:{conn}'.format(
506 url=server_url, ver=version, mode=protocol, conn=connection)
514 url=server_url, ver=version, workers=workers, mode=protocol,
515 conn=connection)
507
516
508 return SysInfoRes(value=value, state=state, human_value=human_value)
517 return SysInfoRes(value=value, state=state, human_value=human_value)
509
518
@@ -526,12 +535,12 b' def rhodecode_app_info():'
526
535
527 def rhodecode_config():
536 def rhodecode_config():
528 import rhodecode
537 import rhodecode
529 import ConfigParser
538 import ConfigParser as configparser
530 path = rhodecode.CONFIG.get('__file__')
539 path = rhodecode.CONFIG.get('__file__')
531 rhodecode_ini_safe = rhodecode.CONFIG.copy()
540 rhodecode_ini_safe = rhodecode.CONFIG.copy()
532
541
533 try:
542 try:
534 config = ConfigParser.ConfigParser()
543 config = configparser.ConfigParser()
535 config.read(path)
544 config.read(path)
536 parsed_ini = config
545 parsed_ini = config
537 if parsed_ini.has_section('server:main'):
546 if parsed_ini.has_section('server:main'):
@@ -89,10 +89,7 b' def get_supported_backends():'
89 return settings.BACKENDS.keys()
89 return settings.BACKENDS.keys()
90
90
91
91
92 def get_vcsserver_version():
92 def get_vcsserver_service_data():
93 from rhodecode.lib.vcs import connection
93 from rhodecode.lib.vcs import connection
94 data = connection.Service.get_vcsserver_service_data()
94 return connection.Service.get_vcsserver_service_data()
95 if data and 'version' in data:
96 return data['version']
97
95
98 return None
General Comments 0
You need to be logged in to leave comments. Login now