Browse Source

[Update] 修改settings

pull/3313/head
ibuler 5 years ago
parent
commit
dc5598f8dc
  1. 5
      apps/assets/tasks/const.py
  2. 1
      apps/jumpserver/conf.py
  3. 3
      apps/jumpserver/settings.py
  4. 4
      jms

5
apps/assets/tasks/const.py

@ -1,10 +1,13 @@
# -*- coding: utf-8 -*-
#
import os
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
PERIOD_TASK_ENABLED = os.environ.get("PERIOD_TASK", "on") == 'on'
ENV_PERIOD_TASK = os.environ.get("PERIOD_TASK", "on") == 'on'
PERIOD_TASK_ENABLED = settings.PERIOD_TASK_ENABLED and ENV_PERIOD_TASK
UPDATE_ASSETS_HARDWARE_TASKS = [
{

1
apps/jumpserver/conf.py

@ -391,6 +391,7 @@ defaults = {
'WINDOWS_SSH_DEFAULT_SHELL': 'cmd',
'FLOWER_URL': "127.0.0.1:5555",
'DEFAULT_ORG_SHOW_ALL_USERS': True,
'PERIOD_TASK_ENABLED': True,
}

3
apps/jumpserver/settings.py

@ -650,3 +650,6 @@ CHANNEL_LAYERS = {
},
},
}
# Enable internal period task
PERIOD_TASK_ENABLED = CONFIG.PERIOD_TASK_ENABLED

4
jms

@ -415,6 +415,10 @@ def get_daemon_context():
files_preserve.append(daemon_log_f)
context = daemon.DaemonContext(
pidfile=pidfile.TimeoutPIDLockFile(daemon_pid_file),
signal_map={
signal.SIGTERM: lambda x, y: clean_up(),
signal.SIGHUP: 'terminate',
},
stdout=daemon_log_f,
stderr=daemon_log_f,
files_preserve=files_preserve,

Loading…
Cancel
Save