@@ -73,9 +73,10 @@ def db_config(db_dir):
73
73
f .close ()
74
74
return db_config_name
75
75
76
- def _support_arg ( arg ):
76
+ def _support_args ( args ):
77
77
ret = subprocess .check_output ([get_rstudio_executable ('rserver' ), '--help' ])
78
- return ret .decode ().find (arg ) != - 1
78
+ help_output = ret .decode ()
79
+ return {arg : (help_output .find (arg ) != - 1 ) for arg in args }
79
80
80
81
def _get_www_frame_origin (default = "same" ):
81
82
try :
@@ -102,13 +103,32 @@ def _get_cmd(port):
102
103
]
103
104
# Support at least v1.2.1335 and up
104
105
105
- if _support_arg ('www-root-path' ):
106
+ supported_args = _support_args ([
107
+ 'www-root-path' ,
108
+ 'server-data-dir' ,
109
+ 'database-config-file' ,
110
+ 'www-thread-pool-size' ,
111
+ 'www-socket' ,
112
+ ])
113
+ if supported_args ['www-root-path' ]:
106
114
cmd .append ('--www-root-path={base_url}rstudio/' )
107
- if _support_arg ( 'server-data-dir' ) :
115
+ if support_args [ 'server-data-dir' ] :
108
116
cmd .append (f'--server-data-dir={ server_data_dir } ' )
109
- if _support_arg ( 'database-config-file' ) :
117
+ if support_args [ 'database-config-file' ] :
110
118
cmd .append (f'--database-config-file={ database_config_file } ' )
111
119
120
+ if supported_args ['www-thread-pool-size' ]:
121
+ try :
122
+ thread_pool_size = int (os .getenv ('RSERVER_THREAD_POOL_SIZE' , "" ))
123
+ if thread_pool_size > 0 :
124
+ cmd .append ('--www-thread-pool-size=' + str (thread_pool_size ))
125
+ except :
126
+ pass
127
+
128
+ #if unix_socket != "":
129
+ # if supported_args['www-socket']:
130
+ # cmd.append('--www-socket={unix_socket}')
131
+
112
132
return cmd
113
133
114
134
def _get_timeout (default = 15 ):
0 commit comments