mirror of https://github.com/jumpserver/jumpserver
perf(ops): 优化定期检查磁盘,添加开关控制
parent
8f7dcd512a
commit
88d8a3326f
|
@ -282,6 +282,7 @@ class Config(dict):
|
|||
'REFERER_CHECK_ENABLED': False,
|
||||
'SERVER_REPLAY_STORAGE': {},
|
||||
'CONNECTION_TOKEN_ENABLED': False,
|
||||
'DISK_CHECK_ENABLED': True,
|
||||
}
|
||||
|
||||
def compatible_auth_openid_of_key(self):
|
||||
|
|
|
@ -116,4 +116,6 @@ DATETIME_DISPLAY_FORMAT = '%Y-%m-%d %H:%M:%S'
|
|||
TICKETS_ENABLED = CONFIG.TICKETS_ENABLED
|
||||
REFERER_CHECK_ENABLED = CONFIG.REFERER_CHECK_ENABLED
|
||||
|
||||
CONNECTION_TOKEN_ENABLED = CONFIG.CONNECTION_TOKEN_ENABLED
|
||||
CONNECTION_TOKEN_ENABLED = CONFIG.CONNECTION_TOKEN_ENABLED
|
||||
DISK_CHECK_ENABLED = CONFIG.DISK_CHECK_ENABLED
|
||||
|
||||
|
|
|
@ -132,6 +132,8 @@ def create_or_update_registered_periodic_tasks():
|
|||
@shared_task
|
||||
@register_as_period_task(interval=3600)
|
||||
def check_server_performance_period():
|
||||
if not settings.DISK_CHECK_ENABLED:
|
||||
return
|
||||
usages = get_disk_usage()
|
||||
uncheck_paths = ['/etc', '/boot']
|
||||
|
||||
|
|
Loading…
Reference in New Issue