diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index f8465da0..f8e9b3e9 100644 --- a/plugin/youcompleteme.vim +++ b/plugin/youcompleteme.vim @@ -109,8 +109,8 @@ let g:ycm_server_log_level = let g:ycm_server_keep_logfiles = \ get( g:, 'ycm_server_keep_logfiles', 0 ) -let g:ycm_server_idle_shutdown_seconds = - \ get( g:, 'ycm_server_idle_shutdown_seconds', 43200 ) +let g:ycm_server_idle_suicide_seconds = + \ get( g:, 'ycm_server_idle_suicide_seconds', 43200 ) " On-demand loading. Let's use the autoload folder and not slow down vim's diff --git a/python/ycm/server/watchdog_plugin.py b/python/ycm/server/watchdog_plugin.py index 82be070f..23c48ae6 100644 --- a/python/ycm/server/watchdog_plugin.py +++ b/python/ycm/server/watchdog_plugin.py @@ -29,7 +29,7 @@ from threading import Thread, Lock # The idea here is to decorate every route handler automatically so that on # every request, we log when the request was made. Then a watchdog thread checks # every check_interval_seconds whether the server has been idle for a time -# greater that the passed-in idle_shutdown_seconds. If it has, we kill the +# greater that the passed-in idle_suicide_seconds. If it has, we kill the # server. # # We want to do this so that if something goes bonkers in Vim and the server @@ -40,13 +40,13 @@ class WatchdogPlugin( object ): def __init__( self, - idle_shutdown_seconds, + idle_suicide_seconds, check_interval_seconds = 60 * 10 ): self._check_interval_seconds = check_interval_seconds - self._idle_shutdown_seconds = idle_shutdown_seconds + self._idle_suicide_seconds = idle_suicide_seconds self._last_request_time = time.time() self._last_request_time_lock = Lock() - if idle_shutdown_seconds <= 0: + if idle_suicide_seconds <= 0: return self._watchdog_thread = Thread( target = self._WatchdogMain ) self._watchdog_thread.daemon = True @@ -66,7 +66,7 @@ class WatchdogPlugin( object ): def _WatchdogMain( self ): while True: time.sleep( self._check_interval_seconds ) - if time.time() - self._GetLastRequestTime() > self._idle_shutdown_seconds: + if time.time() - self._GetLastRequestTime() > self._idle_suicide_seconds: utils.TerminateProcess( os.getpid() ) diff --git a/python/ycm/server/ycmd.py b/python/ycm/server/ycmd.py index a80e1cbc..07d34d68 100755 --- a/python/ycm/server/ycmd.py +++ b/python/ycm/server/ycmd.py @@ -56,7 +56,7 @@ def Main(): parser.add_argument( '--log', type = str, default = 'info', help = 'log level, one of ' '[debug|info|warning|error|critical]' ) - parser.add_argument( '--idle_shutdown_seconds', type = int, default = 0, + parser.add_argument( '--idle_suicide_seconds', type = int, default = 0, help = 'num idle seconds before server shuts down') parser.add_argument( '--options_file', type = str, default = '', help = 'file with user options, in JSON format' ) @@ -85,7 +85,7 @@ def Main(): from ycm.server import handlers handlers.UpdateUserOptions( options ) SetUpSignalHandler() - handlers.app.install( WatchdogPlugin( args.idle_shutdown_seconds ) ) + handlers.app.install( WatchdogPlugin( args.idle_suicide_seconds ) ) waitress.serve( handlers.app, host = args.host, port = args.port, diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 6967c807..bf9d4d99 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -70,8 +70,8 @@ class YouCompleteMe( object ): '--port={0}'.format( server_port ), '--options_file={0}'.format( options_file.name ), '--log={0}'.format( self._user_options[ 'server_log_level' ] ), - '--idle_shutdown_seconds={0}'.format( - self._user_options[ 'server_idle_shutdown_seconds' ] ) ] + '--idle_suicide_seconds={0}'.format( + self._user_options[ 'server_idle_suicide_seconds' ] ) ] BaseRequest.server_location = 'http://localhost:' + str( server_port )