##// END OF EJS Templates
ssh: skip loading parts for SSH to make execution of ssh commands faster.
marcink -
r3910:def4f469 default
parent child Browse files
Show More
@@ -69,6 +69,10 b' def should_load_all():'
69 Returns if all application components should be loaded. In some cases it's
69 Returns if all application components should be loaded. In some cases it's
70 desired to skip apps loading for faster shell script execution
70 desired to skip apps loading for faster shell script execution
71 """
71 """
72 ssh_cmd = os.environ.get('RC_CMD_SSH_WRAPPER')
73 if ssh_cmd:
74 return False
75
72 return True
76 return True
73
77
74
78
@@ -256,9 +260,10 b' def includeme(config):'
256 config.include('rhodecode.apps._base.navigation')
260 config.include('rhodecode.apps._base.navigation')
257 config.include('rhodecode.apps._base.subscribers')
261 config.include('rhodecode.apps._base.subscribers')
258 config.include('rhodecode.tweens')
262 config.include('rhodecode.tweens')
263 config.include('rhodecode.authentication')
259
264
260 config.include('rhodecode.integrations')
265 if load_all:
261 config.include('rhodecode.authentication')
266 config.include('rhodecode.integrations')
262
267
263 if load_all:
268 if load_all:
264 from rhodecode.authentication import discover_legacy_plugins
269 from rhodecode.authentication import discover_legacy_plugins
@@ -275,9 +280,8 b' def includeme(config):'
275 discover_legacy_plugins(config)
280 discover_legacy_plugins(config)
276
281
277 # apps
282 # apps
278 config.include('rhodecode.apps._base')
279
280 if load_all:
283 if load_all:
284 config.include('rhodecode.apps._base')
281 config.include('rhodecode.apps.ops')
285 config.include('rhodecode.apps.ops')
282 config.include('rhodecode.apps.admin')
286 config.include('rhodecode.apps.admin')
283 config.include('rhodecode.apps.channelstream')
287 config.include('rhodecode.apps.channelstream')
@@ -303,14 +307,15 b' def includeme(config):'
303 settings['default_locale_name'] = settings.get('lang', 'en')
307 settings['default_locale_name'] = settings.get('lang', 'en')
304
308
305 # Add subscribers.
309 # Add subscribers.
306 config.add_subscriber(inject_app_settings,
310 if load_all:
307 pyramid.events.ApplicationCreated)
311 config.add_subscriber(inject_app_settings,
308 config.add_subscriber(scan_repositories_if_enabled,
312 pyramid.events.ApplicationCreated)
309 pyramid.events.ApplicationCreated)
313 config.add_subscriber(scan_repositories_if_enabled,
310 config.add_subscriber(write_metadata_if_needed,
314 pyramid.events.ApplicationCreated)
311 pyramid.events.ApplicationCreated)
315 config.add_subscriber(write_metadata_if_needed,
312 config.add_subscriber(write_js_routes_if_enabled,
316 pyramid.events.ApplicationCreated)
313 pyramid.events.ApplicationCreated)
317 config.add_subscriber(write_js_routes_if_enabled,
318 pyramid.events.ApplicationCreated)
314
319
315 # request custom methods
320 # request custom methods
316 config.add_request_method(
321 config.add_request_method(
@@ -18,6 +18,7 b''
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import os
21 import atexit
22 import atexit
22 import logging
23 import logging
23
24
@@ -28,6 +29,10 b' cache_keys_by_pid = []'
28
29
29 @atexit.register
30 @atexit.register
30 def free_cache_keys():
31 def free_cache_keys():
32 ssh_cmd = os.environ.get('RC_CMD_SSH_WRAPPER')
33 if ssh_cmd:
34 return
35
31 from rhodecode.model.db import Session, CacheKey
36 from rhodecode.model.db import Session, CacheKey
32 log.info('Clearing %s cache keys', len(cache_keys_by_pid))
37 log.info('Clearing %s cache keys', len(cache_keys_by_pid))
33
38
General Comments 0
You need to be logged in to leave comments. Login now