Commit dc5598f8 authored by ibuler's avatar ibuler

[Update] 修改settings

parent c6fef203
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
import os import os
from django.conf import settings
from django.utils.translation import ugettext_lazy as _ 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 = [ UPDATE_ASSETS_HARDWARE_TASKS = [
{ {
......
...@@ -391,6 +391,7 @@ defaults = { ...@@ -391,6 +391,7 @@ defaults = {
'WINDOWS_SSH_DEFAULT_SHELL': 'cmd', 'WINDOWS_SSH_DEFAULT_SHELL': 'cmd',
'FLOWER_URL': "127.0.0.1:5555", 'FLOWER_URL': "127.0.0.1:5555",
'DEFAULT_ORG_SHOW_ALL_USERS': True, 'DEFAULT_ORG_SHOW_ALL_USERS': True,
'PERIOD_TASK_ENABLED': True,
} }
......
...@@ -650,3 +650,6 @@ CHANNEL_LAYERS = { ...@@ -650,3 +650,6 @@ CHANNEL_LAYERS = {
}, },
}, },
} }
# Enable internal period task
PERIOD_TASK_ENABLED = CONFIG.PERIOD_TASK_ENABLED
...@@ -415,6 +415,10 @@ def get_daemon_context(): ...@@ -415,6 +415,10 @@ def get_daemon_context():
files_preserve.append(daemon_log_f) files_preserve.append(daemon_log_f)
context = daemon.DaemonContext( context = daemon.DaemonContext(
pidfile=pidfile.TimeoutPIDLockFile(daemon_pid_file), pidfile=pidfile.TimeoutPIDLockFile(daemon_pid_file),
signal_map={
signal.SIGTERM: lambda x, y: clean_up(),
signal.SIGHUP: 'terminate',
},
stdout=daemon_log_f, stdout=daemon_log_f,
stderr=daemon_log_f, stderr=daemon_log_f,
files_preserve=files_preserve, files_preserve=files_preserve,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment